Immutable and Mutable References
//Remove every mut to see error fn main() { let mut s = String::from("hello"); change(&mut s); println!("s is {}", s); } fn change(s: &mut String) { s.push_str(", world!") }
//Remove every mut to see error fn main() { let mut s = String::from("hello"); change(&mut s); println!("s is {}", s); } fn change(s: &mut String) { s.push_str(", world!") }