Skip to content

Commit cea65b3

Browse files
committed
Add split_first/split_last to unresolved questions
Add the suggested `split_` prefix as a name option, albeit with the names `split_first()`/`split_last()` instead of the originally-suggested `split_init()`/`split_tail()`. Add a question about the return type of `shift_last()`.
1 parent 1cbabb0 commit cea65b3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

text/0000-slice-tail-redesign.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ Is the name correct? There's precedent in this name in the form of
9696
[`str::slice_shift_char()`][slice_shift_char]. An alternative name might be
9797
`pop_first()`/`pop_last()`, or `shift_front()`/`shift_back()` (although the
9898
usage of `first`/`last` was chosen to match the existing methods `first()` and
99-
`last()`).
99+
`last()`). Another option is `split_first()`/`split_last()`.
100+
101+
Should `shift_last()` return `Option<(&T, &[T])>` or `Option<(&[T], &T)>`?
102+
I believe that the former is correct with this name, but the latter might be
103+
more suitable given the name `split_last()`.
100104

101105
[slice_shift_char]: http://doc.rust-lang.org/nightly/std/primitive.str.html#method.slice_shift_char

0 commit comments

Comments
 (0)