diff --git a/crates/bevy_ecs/src/storage/table.rs b/crates/bevy_ecs/src/storage/table.rs index 8d6b03d1da189..3c06b41b91a48 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`]. #[inline] pub const fn from_usize(index: usize) -> Self { - assert!(index as u32 as usize == index); + debug_assert!(index as u32 as usize == index); Self(index as u32) } @@ -116,7 +116,7 @@ impl TableRow { /// Will panic if the provided value does not fit within a [`u32`]. #[inline] pub const fn from_usize(index: usize) -> Self { - assert!(index as u32 as usize == index); + debug_assert!(index as u32 as usize == index); Self(index as u32) }