Make Entity::to_bits const (#6559)
# Objective Fix #6548. Most of these methods were already made `const` in #5688. `Entity::to_bits` is the only one that remained. ## Solution Make it const.
This commit is contained in:
parent
c3c4088317
commit
2179a3ebf4
@ -176,8 +176,8 @@ impl Entity {
|
|||||||
/// for serialization between runs.
|
/// for serialization between runs.
|
||||||
///
|
///
|
||||||
/// No particular structure is guaranteed for the returned bits.
|
/// No particular structure is guaranteed for the returned bits.
|
||||||
pub fn to_bits(self) -> u64 {
|
pub const fn to_bits(self) -> u64 {
|
||||||
u64::from(self.generation) << 32 | u64::from(self.index)
|
(self.generation as u64) << 32 | self.index as u64
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Reconstruct an `Entity` previously destructured with [`Entity::to_bits`].
|
/// Reconstruct an `Entity` previously destructured with [`Entity::to_bits`].
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user