-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Implement a few methods for RingBuf #20197
Conversation
r? @huonw (rust_highfive has picked a reviewer for you, use r? to override) |
0646db8
to
13be65b
Compare
/// It will drop down as close as possible to the length but the allocator may still inform the | ||
/// vector that there is space for a few more elements. | ||
/// | ||
/// Returns `None` if `index` is out of bounds. |
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.
This function does not seem to return anything judging by its type notation.
13be65b
to
8c3436e
Compare
/// # Examples | ||
/// | ||
/// ``` | ||
/// let mut vec = vec![1i, 2, 3, 4]; |
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.
This example needs to be updated.
Done review. |
c6c6946
to
e0c06b7
Compare
@pczarn I see you've added some commits; is that everything or are you still working on it (basically: should I re-review now?) |
@gankro that's everything, except for swap_.._remove tests; hope to add them now. |
self.cap); | ||
ptr::copy_nonoverlapping_memory( | ||
self.ptr.offset(dst as int), | ||
self.ptr.offset(src as int) as *const T, |
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 think the as *const T
should just coerce for free? Still trying to grok when these coercions do or don't kick in, though.
Okay lgtm modulo nits/tests. |
603fadd
to
f47dd53
Compare
f47dd53
to
00f8cdf
Compare
r=me with squash |
b216a09
to
841b458
Compare
@gankro, done. |
* shrink_to_fit * swap_back_remove * swap_front_remove * truncate * resize
841b458
to
156a1c3
Compare
Part of collections reform part 1 and 2, rust-lang#18424 and rust-lang#19986 * shrink_to_fit * swap_back_remove * swap_front_remove * truncate * resize
Part of collections reform part 1 and 2, #18424 and #19986