RBE types literals

This commit is contained in:
Dan Buch 2021-10-25 09:32:37 -04:00
parent d326a055f7
commit abd957d42f
Signed by: meatballhat
GPG Key ID: 9685130D8B763EA7

View File

@ -0,0 +1,14 @@
fn main() {
let x = 1u8;
let y = 2u32;
let z = 3f32;
let i = 1;
let f = 1.0;
println!("size of `x` in bytes: {}", std::mem::size_of_val(&x));
println!("size of `y` in bytes: {}", std::mem::size_of_val(&y));
println!("size of `z` in bytes: {}", std::mem::size_of_val(&z));
println!("size of `i` in bytes: {}", std::mem::size_of_val(&i));
println!("size of `f` in bytes: {}", std::mem::size_of_val(&f));
}