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
In fact, as the second example shows, index == len is allowed. The phrase "out of bounds" is used in the docs of other methods (remove and swap_remove) to mean 0 <= index < len so it should not be used to mean 0 <= index <= len here.
Suggest changing the wording to match Vec::split_off :
Panics if index > len.
The text was updated successfully, but these errors were encountered:
sfackler
added
the
A-docs
Area: documentation for any part of the project, including the compiler, standard library, and tools
label
Dec 30, 2017
frewsxcv
added a commit
to frewsxcv/rust
that referenced
this issue
Jan 2, 2018
rust/src/liballoc/vec.rs
Lines 716 to 718 in f0e5c95
In fact, as the second example shows,
index == len
is allowed. The phrase "out of bounds" is used in the docs of other methods (remove
andswap_remove
) to mean0 <= index < len
so it should not be used to mean0 <= index <= len
here.Suggest changing the wording to match
Vec::split_off
:The text was updated successfully, but these errors were encountered: