-
-
Save stepancheg/45801920029fa8a155c5b746d98ca9a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/crates/bevy_ecs/src/storage/table.rs b/crates/bevy_ecs/src/storage/table.rs | |
index 4b9ebc293..8784693d9 100644 | |
--- a/crates/bevy_ecs/src/storage/table.rs | |
+++ b/crates/bevy_ecs/src/storage/table.rs | |
@@ -56,7 +56,7 @@ impl TableId { | |
/// Will panic if the provided value does not fit within a [`u32`] with `debug_assertions`. | |
#[inline] | |
pub const fn from_usize(index: usize) -> Self { | |
- debug_assert!(index as u32 as usize == index); | |
+ assert!(index as u32 as usize == index); | |
Self(index as u32) | |
} | |
@@ -73,7 +73,7 @@ impl TableId { | |
/// Will panic if the inner value does not fit within a [`usize`] with `debug_assertions`. | |
#[inline] | |
pub const fn as_usize(self) -> usize { | |
- debug_assert!(self.0 as usize as u32 == self.0); | |
+ assert!(self.0 as usize as u32 == self.0); | |
self.0 as usize | |
} | |
@@ -120,7 +120,7 @@ impl TableRow { | |
/// Will panic if the provided value does not fit within a [`u32`] with `debug_assertions`. | |
#[inline] | |
pub const fn from_usize(index: usize) -> Self { | |
- debug_assert!(index as u32 as usize == index); | |
+ assert!(index as u32 as usize == index); | |
Self(index as u32) | |
} | |
@@ -131,7 +131,7 @@ impl TableRow { | |
/// Will panic if the inner value does not fit within a [`usize`] with `debug_assertions`. | |
#[inline] | |
pub const fn as_usize(self) -> usize { | |
- debug_assert!(self.0 as usize as u32 == self.0); | |
+ assert!(self.0 as usize as u32 == self.0); | |
self.0 as usize | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment