Answers for "rust vec cannot move"

1

rust vec cannot move

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()
Posted by: Guest on March-31-2022

Browse Popular Code Answers by Language