Skip to content

Implement append and split_off for BitVec (RFC 509) #24890

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

Merged
merged 1 commit into from
May 7, 2015

Conversation

jooert
Copy link
Contributor

@jooert jooert commented Apr 28, 2015

cc #19986

r? @gankro

#[unstable(feature = "collections",
reason = "recently added as part of collections reform 2")]
pub fn append(&mut self, other: &mut Self) {
let b = self.len() % u32::BITS;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd appreciate a more useful name than b.

@Gankra
Copy link
Contributor

Gankra commented Apr 29, 2015

Sorry for the delayed response. Review done!

@jooert jooert force-pushed the bitvec-append-split_off branch from a2f1c3f to fb9419a Compare April 29, 2015 22:04
@jooert
Copy link
Contributor Author

jooert commented Apr 29, 2015

Thank you for your review! I fixed everything you noted, except for the assertion regarding the internal representation and the feature gate.

@Gankra
Copy link
Contributor

Gankra commented Apr 30, 2015

Alright, r=me with the feature gate fixed (which I'll go ping someone to get an answer on).

@jooert jooert force-pushed the bitvec-append-split_off branch from fb9419a to 7311394 Compare May 5, 2015 16:56
@jooert
Copy link
Contributor Author

jooert commented May 5, 2015

I have changed the name of the feature gate to bit_vec_append_split_off. So everything should be fine now.

/// # Examples
///
/// ```
/// # #![feature(collections)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the feature list in this documentation (and the above example) will need to be updated. You can also be sure to run these tests with make check-stage2-doc-crate-collections

@jooert jooert force-pushed the bitvec-append-split_off branch from 7311394 to 9fa6e4c Compare May 5, 2015 21:38
@jooert
Copy link
Contributor Author

jooert commented May 5, 2015

@alexcrichton Fixed everything you noted and had to update the call to Vec::drain since it takes a range parameter now.

@alexcrichton
Copy link
Member

@bors: r=Gankro 9fa6e4c

Thanks @jooert!

@bors
Copy link
Collaborator

bors commented May 6, 2015

⌛ Testing commit 9fa6e4c with merge 3d544f2...

@bors
Copy link
Collaborator

bors commented May 6, 2015

💔 Test failed - auto-mac-64-opt

@jooert jooert force-pushed the bitvec-append-split_off branch from 9fa6e4c to d55a7e8 Compare May 6, 2015 07:29
@jooert
Copy link
Contributor Author

jooert commented May 6, 2015

Ahh, I forgot to enable the feature gate in libcollectionstest. Sorry for wasting CPU time!
make check-stage1 passes with no errors locally now, so (hopefully) it should be good to go. Retry?

@alexcrichton
Copy link
Member

@bors: r+ d55a7e8

No worries!

@bors
Copy link
Collaborator

bors commented May 7, 2015

⌛ Testing commit d55a7e8 with merge e8b4c84...

@bors bors merged commit d55a7e8 into rust-lang:master May 7, 2015
@jooert jooert deleted the bitvec-append-split_off branch May 7, 2015 06:55
Manishearth added a commit to Manishearth/rust that referenced this pull request May 9, 2015
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.

4 participants