We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 65e7684 commit 673c879Copy full SHA for 673c879
src/tools/miri/bench-cargo-miri/mse/src/main.rs
@@ -13,7 +13,7 @@ fn read_i16(buffer: &[u8], index: usize) -> i16 {
13
const SIZE: usize = size_of::<i16>();
14
let mut bytes: [u8; SIZE] = [0u8; SIZE];
15
bytes.copy_from_slice(&buffer[(index * SIZE)..(index * SIZE + SIZE)]);
16
- unsafe { std::mem::transmute(bytes) }
+ i16::from_ne_bytes(bytes)
17
}
18
19
fn mse(samples: usize, frame_buf: &[i16], buf_ref: &[u8]) -> f64 {
0 commit comments