Skip to content
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

Allow index of split_off to equal length of vector #33

Merged
merged 1 commit into from
Aug 2, 2018

Conversation

bbc2
Copy link
Contributor

@bbc2 bbc2 commented Jul 26, 2018

Allows:

    let mut left = vector![0, 1, 2];
    let right = left.split_off(3);
    assert_eq!(left, vector![0, 1, 2]);
    assert_eq!(right, vector![]);

This makes it more similar to the primitive slice split_at from the standard library (see https://doc.rust-lang.org/std/primitive.slice.html#method.split_at).

This makes it similar to the primitive slice `split_at` from the
standard library (see
https://doc.rust-lang.org/std/primitive.slice.html#method.split_at).
@bodil
Copy link
Owner

bodil commented Aug 2, 2018

This makes a lot of sense. 👍

@bodil bodil merged commit b314454 into bodil:master Aug 2, 2018
@bbc2 bbc2 deleted the vector-allow-split-end branch August 2, 2018 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants