Closed
Description
Location
In the second example of each of these:
Summary
The second example of these two APIs are described as follows:
Splitting off the last two elements of a slice:
let mut slice: &[_] = &['a', 'b', 'c', 'd'];
let mut tail = slice.split_off(2..).unwrap();
assert_eq!(slice, &['a', 'b']);
assert_eq!(tail, &['c', 'd']);
I believe this is intended as a simple description of what the example is doing, which isn't wrong.
-> However, it is only correct if the slice is 4 elements total.
Suggested correction:
"Splitting off a slice from the third element to the last:"