Description
In:
- http://doc.rust-lang.org/std/vec/struct.Vec.html#method.slice
- http://doc.rust-lang.org/std/slice/trait.ImmutableVector.html#tymethod.slice
The documentation states
Fails when start or end point outside the bounds of self
Since slice isn't inclusive, this isn't exactly true. With end == len, end definitely points outside the bounds of self (in the sense that you couldn't do v.get(end), which seems like the obvious interpretation), yet .slice will not fail.
A straightforward reading of the documentation for slice seems to suggest it is inclusive. Maybe write
Returns a slice of self from start up to, but not including, end.
or
Returns a slice of self spanning the interval [start, end).
Or something else (since both of these are kinda awkward and don't fix the next sentence).
I feel like slice's documentation should make the semantics of the method as clear and unambiguous as possible.