12 lines
302 B
Rust
12 lines
302 B
Rust
use smartstring::{Compact, SmartString};
|
|
use std::mem::size_of_val;
|
|
|
|
fn main() {
|
|
let smart = SmartString::<Compact>::from("hello world");
|
|
dbg!(size_of_val(&smart));
|
|
|
|
let stand = String::from("hello world");
|
|
dbg!(size_of_val(&stand));
|
|
dbg!(size_of_val(&stand) + stand.capacity());
|
|
}
|