struct A {
pub v: Vec<i32>
}
fn extract(a: &mut A) -> Vec<i32> {
let res = a.v.clone(); // TODO: move out of a.v
res
}
How to move out a Vec<T>
while it's inside a &mut
struct?
struct A {
pub v: Vec<i32>
}
fn extract(a: &mut A) -> Vec<i32> {
let res = a.v.clone(); // TODO: move out of a.v
res
}
How to move out a Vec<T>
while it's inside a &mut
struct?