1 Ownership & borrowing
Each value has one owner; when it goes out of scope it is dropped. Borrowing (&) lends access without transferring ownership — the borrow checker prevents data races at compile time.
fn main() {
let s = String::from("hi");
let len = calc(&s); // borrow
println!("{} {}", s, len);
}
fn calc(x: &String) -> usize { x.len() }