Rust Standard Library Cookbook
上QQ阅读APP看书,第一时间看更新

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.