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 41ca2b3 commit 525c02fCopy full SHA for 525c02f
data-in-depth/src/main.rs
@@ -13,7 +13,7 @@ fn print_16bit_integers() {
13
println!("a: {:016b} {}", a, a);
14
println!("b: {:016b} {}", b, b);
15
16
- let c: u16 = unsafe { std::mem::transmute(-1378i16) };
+ let c: u16 = i16::cast_unsigned(-1378i16);
17
18
println!("c: {:016b} {}", c, c);
19
}
0 commit comments