-
Rust::Alloc
-
::Vec
_ = vec![1,2,3,4,5]; // same as Box::new([1,2,3,4,5]).into_vec(); // so the capacity is 5 as .len()
struct ClonableStruct; impl Clone for ClonableStruct { fn clone(&self) -> Self { eprintln!("cloned!"); Self } } _ = vec![ClonableStruct; 10]; // will print out "cloned!" 9 times // first one is just original
-