We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
u64::to_le
1 parent 0ceca1f commit b068908Copy full SHA for b068908
src/atom.rs
@@ -103,18 +103,7 @@ impl<Static> Atom<Static> {
103
#[inline(always)]
104
#[doc(hidden)]
105
pub const fn pack_inline(n: u64, len: u8) -> Self {
106
- // Reverse byte order if big-endian
107
- let n = if cfg!(target_endian = "big") {
108
- ((n & 0x000000000000FF00) << 48)
109
- | ((n & 0x0000000000FF0000) << 32)
110
- | ((n & 0x00000000FF000000) << 16)
111
- | (n & 0x000000FF00000000)
112
- | ((n & 0x0000FF0000000000) >> 16)
113
- | ((n & 0x00FF000000000000) >> 32)
114
- | ((n & 0xFF00000000000000) >> 48)
115
- } else {
116
- n
117
- };
+ let n = n.to_le();
118
119
let data: u64 = (INLINE_TAG as u64) | ((len as u64) << LEN_OFFSET) | n;
120
Self {
0 commit comments