📅  最后修改于: 2022-03-11 15:04:05.054000             🧑  作者: 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
}