is there any built-in method for Vec<T> that removes the first/last element and returns Option<T>
-
Show this thread
-
remove(0) returns T or panics
1 reply 0 retweets 0 likesShow this thread
Replying to @mountain_ghosts
pop works for the back of the vec https://doc.rust-lang.org/std/vec/struct.Vec.html#method.pop … There's no method for the front, but if you use a deque instead you do get that ability.
1:31 PM - 22 Apr 2019
from Berlin, Germany
0 replies
0 retweets
1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.