Created
August 22, 2019 07:34
-
-
Save rust-play/99fda6749992024550ff2142e2207c7a to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::mem::size_of; | |
use std::num::NonZeroI8; | |
fn main() { | |
println!("i8: {}, nonzero i8: {}", size_of::<Option<i8>>(), size_of::<Option<NonZeroI8>>()); | |
println!("vec: {}, option: {}", size_of::<Vec<u8>>(), size_of::<Option<Vec<u8>>>()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment