There is the following struct:
struct Data {
xs: Vec<i32>,
ys: Vec<i32>
}
At attempt to assign one vector of the struct to the other as follows leads to an error:
impl Data {
fn proc(&mut self) {
self.xs = self.ys;
}
}
The error is move occurs because self.ys has type Vec<i32>, which does not implement the Copy trait.
The struct is borrowed as mutable, why it is not possible to move from self.ys there?