@debug_format [$debug_format:tt]) => (
#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, $($derives),*)]
$v struct $type {
- private: ::std::num::NonZeroU32
+ private: u32
}
impl $type {
#[inline]
$v const unsafe fn from_u32_unchecked(value: u32) -> Self {
- $type { private: ::std::num::NonZeroU32::new_unchecked(value + 1) }
+ $type { private: value }
}
/// Extract value of this index as an integer.
/// Extract value of this index as a usize.
#[inline]
- $v fn as_u32(self) -> u32 {
- self.private.get() - 1
+ $v const fn as_u32(self) -> u32 {
+ self.private
}
/// Extract value of this index as a u32.
#[inline]
- $v fn as_usize(self) -> usize {
+ $v const fn as_usize(self) -> usize {
self.as_u32() as usize
}
}