Rust newbie here. I'm trying to write a function which consumes the passed vector, modifies it, appends it to another vector and returns it.
Here is my code:
fn try(other: Vec<(String, String)>) -> Vec<(String, String)> {
let mut res = Vec::new();
let mut neg: Vec<(String,String)> = other
.iter()
.map(|t| (t.0, String::from("abc")))
.collect();
res.append(&mut neg);
res
}
However, I'm getting a cannot move out borrowed content
at t.0
. What is it that I'm doing wrong? What's getting passed into the closure?