complete version
This commit is contained in:
10
box-str-program/Cargo.toml
Normal file
10
box-str-program/Cargo.toml
Normal file
@ -0,0 +1,10 @@
|
||||
[package]
|
||||
name = "box-str-program"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
dhat = "0.3.0"
|
||||
|
||||
[features]
|
||||
dhat-heap = [] # if you are doing heap profiling
|
6
box-str-program/src/main.rs
Normal file
6
box-str-program/src/main.rs
Normal file
@ -0,0 +1,6 @@
|
||||
fn main() {
|
||||
let boxed_str: Box<str> = "hello".into();
|
||||
|
||||
println!("boxed_str: {}", boxed_str);
|
||||
println!("size of boxed_str on stack: {}", std::mem::size_of_val(&boxed_str));
|
||||
}
|
Reference in New Issue
Block a user