I'm having trouble concatenating the two lines, I'm very new to rust. If there is an easier way to do this, please feel free to show me.
My function goes through a vector of string tuples (String,String), what I want to do is combine these two string elements into one string. Here is what I have:
for tup in bmp.bitmap_picture.mut_iter() {
let &(ref x, ref y) = tup;
let res_string = x;
res_string.append(y.as_slice());
}
but I get an error: error: cannot move out of dereference of '&'-pointerfor the line:res_string.append(y.as_slice());
I also tried res_string.append(y.clone().as_slice());, but the same error occurred, so I'm not sure if that was even correct.
source
share