You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, since const panics are now a thing, we can assert that the node id passed to Guid::from_values has the high 16 bits cleared and take a u64 instead of a [u8; 6]. I've also cleaned up the Display implementation for Guid, replacing the manual bitshifts with the u16::from_be_bytes and u64::from_be_bytes stdlib functions. The functionality is identical (it actually ends up compiling down to the same thing, according to godbolt), but the code ends up being simpler and easier to read.
The included test suite passes with either or both changes.
The text was updated successfully, but these errors were encountered:
Hi, since const panics are now a thing, we can assert that the node id passed to Guid::from_values has the high 16 bits cleared and take a u64 instead of a [u8; 6]. I've also cleaned up the Display implementation for Guid, replacing the manual bitshifts with the u16::from_be_bytes and u64::from_be_bytes stdlib functions. The functionality is identical (it actually ends up compiling down to the same thing, according to godbolt), but the code ends up being simpler and easier to read.
The included test suite passes with either or both changes.
The text was updated successfully, but these errors were encountered: