We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d5fcee8 commit f5e1f47Copy full SHA for f5e1f47
src/mem/impls.rs
@@ -30,7 +30,7 @@ unsafe fn read_usize_unaligned(x: *const usize) -> usize {
30
// Do not use `core::ptr::read_unaligned` here, since it calls `copy_nonoverlapping` which
31
// is translated to memcpy in LLVM.
32
let x_read = (x as *const [u8; core::mem::size_of::<usize>()]).read();
33
- core::mem::transmute(x_read)
+ usize::from_ne_bytes(x_read)
34
}
35
36
#[inline(always)]
0 commit comments