📅  最后修改于: 2022-03-11 14:49:25.099000             🧑  作者: Mango
// Copy an array
fn main() {
let arr = ["a","b","c"];
let mut another = arr.clone(); // make a copy
println!("copy of arr = {:?} ", another);
another[1] = "d"; // make a change
assert_eq!(arr, another); // panic, no longer equal
}