When should I clone vs borrow

Clone creates a deep copy of data for independent use, while borrowing provides access to the original data without duplication.

Clone when you need a deep copy of the data; borrow when you only need to read or modify the original without taking ownership. Use .clone() to duplicate values like String or Vec, and use references (&T or &mut T) to access data without copying it.

let s1 = String::from("hello");
let s2 = s1.clone(); // Deep copy: s1 and s2 are independent
let s3 = &s1;        // Borrow: s3 references s1, no copy made