-
Notifications
You must be signed in to change notification settings - Fork 13.5k
add split_off method to vec with tests #21608
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add split_off method to vec with tests #21608
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
r? @gankro |
/// Splits the collection into two at the given index. | ||
/// | ||
/// Returns a newly allocated `Self`. `self` contains elements `[0..at]`, | ||
/// and the returned `Self` contains elements `[at ..]`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit nervosd about this since this is accurate Rust notation, but confusing as math notation.
probably fine as is, though.
@gankro I've made all the changes required by the comments, please review. I'll squash my commits down if it looks good. |
r=me with assert message and squash |
I was going off the (lack of) message in slice.split_at |
8696e9a
to
b93843e
Compare
r? @gankro |
@bors r+ b938 rollup |
@brson @gankro