Changing In A Function
SOURCE CODE
fn main() { let mut alfa = String::from("widget"); println!("alfa is {alfa}"); update_value(&mut alfa); println!("alfa is {alfa}"); } fn update_value(value: &mut String) { value.push_str("-thing"); }
fn main() { let mut alfa = String::from("widget"); println!("alfa is {alfa}"); update_value(&mut alfa); println!("alfa is {alfa}"); } fn update_value(value: &mut String) { value.push_str("-thing"); }