- Rust Standard Library Cookbook
- Jan Nils Ferner Daniel Durante
- 58字
- 2021-08-27 19:45:12
Using a VecDeque
When you need to insert or remove elements regularly into or from the beginning of the vector, your performance might take quite a hit, as it will force the vector to reallocate all data that comes after it. This is especially bothersome when implementing a queue. For this reason, Rust provides you with the VecDeque.