// &[i32] borrows any Vec or array without moving it
fn total(v: &[i32]) -> i32 {
v.iter().sum()
}
fn main() {
let nums = vec![1, 2, 3];
println!("{}", total(&nums));
// nums is still owned here
println!("still have {} items", nums.len());
}&[T] reads without taking ownership