I am a newbie in Rust. I want to iterate through a vector of String and modify the values. How will one do it? Below is the code I wrote, but it fails.
let mut val: [&str; 3] = ["Hello", "Hi", "Hey"];
for value in val.iter_mut() {
*value = *value + "a";
println!("{}", value);
}
Say I just want to add the letter “a” to each of the elements in val.