fn main() { let mut x = String::from("aaa"); let mut f = |z: &String| { x.push_str("ccc"); z.len() == x.len() }; let y = String::from("bbb"); let a = f(&y); println!("{}", a); println!("{:?}", x); println!("{:?}", y); }