Question : rust vec cannot move
Answered by : zwazel
You can't do a move using an indexing op because they are defined using references. Rust is notably missing a move reference, so you can't use an indexing op to move out of a vector.
Use .get() or .get_mut()
Source : https://users.rust-lang.org/t/why-cant-move-element-of-vector/30454/2 | Last Update : Thu, 07 Apr 22