// &mut Vec lets the function modify the caller's data fn push_zero(v: &mut Vec<i32>) { v.push(0); } fn main() { let mut nums = vec![1, 2]; push_zero(&mut nums); println!("{:?}", nums); }
&mut lets the callee change your value