t_wの輪郭

RustRc参照カウント
Rc#cloneclone

clone

2022/2/16 16:01:00

deep copyするメソッド

let s1 = String::from("hello");
let s2 = s1.clone();