标签: rust
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 }
如何在Vec<T>结构内移出&mut?
Vec<T>
&mut
这是How can I swap in a new value for a field in a mutable reference to a structure?