You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is get counts from top or from bottom? Basically, from this example it's hard to get simple answer, what buf.get(2) would be, 3 or 5?
I understand, that deeper thinking may lead to a proper conclusion, but, by adding one more line buf.push_back(6); can clarify it without causing any doubts.
Location
https://doc.rust-lang.org/std/collections/struct.VecDeque.html#method.get
Summary
There is a bit of ambiguity about 'front' and 'back' thing in VecDeque, and documentation example fuel this uncertainty a bit:
Is
get
counts from top or from bottom? Basically, from this example it's hard to get simple answer, whatbuf.get(2)
would be,3
or5
?I understand, that deeper thinking may lead to a proper conclusion, but, by adding one more line
buf.push_back(6);
can clarify it without causing any doubts.My proposal is to change it to
In this example there is only one way to interpret 'offset 1' without any ambiguity.
The text was updated successfully, but these errors were encountered: