clone() — deep copy, explicit. Copy — shallow copy, implicit.
clone():
1let s1 = String::from("hello");2let s2 = s1.clone(); // Deep copy3println!("{} {}", s1, s2); // Both valid
Copy trait:
1let x = 5;2let y = x; // Copy (implicit)3println!("{} {}", x, y); // Both valid
Types that implement Copy:
Key differences: