Add an as_u32() member to entity_impl types.
This allows us to avoid a lot of casting indices back to u32.
This commit is contained in:
@@ -98,6 +98,13 @@ macro_rules! entity_impl {
|
||||
$entity($crate::__core::u32::MAX)
|
||||
}
|
||||
}
|
||||
|
||||
impl $entity {
|
||||
/// Return the underlying index value as a `u32`.
|
||||
pub fn as_u32(self) -> u32 {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Include basic `Display` impl using the given display prefix.
|
||||
|
||||
Reference in New Issue
Block a user