VecDeque, extend, but front?

Does VecDeque have something like VecDeque in std::collections - Rust , but pushes to the front instead of the back ?

4 Likes

You can push in a loop?

I encontered similar situation when dealing with PathBufs,in which I shall convert the first element to another. I decleared a reversed PathBuf that get elements from the original one, then change that element, then push each elements back one by one. This is obviously not what you want,I'd like to see if there's another way.

Yes, I'm currently using a loop. I am wondering if there is a builtin since push_front / push_back is symmetric, but we have extend/append, but not for front.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.