-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Minor cleanup for slice::Chunks and ChunksMut #47113
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @dtolnay (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
2a17b1b
to
5ad4694
Compare
src/libcore/slice/mod.rs
Outdated
@@ -348,9 +348,9 @@ impl<T> SliceExt for [T] { | |||
} | |||
|
|||
#[inline] | |||
fn chunks(&self, size: usize) -> Chunks<T> { | |||
fn chunks(&self, chunk_size: usize) -> Chunks<T> { | |||
assert!(size != 0); |
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.
size
here needs to be updated
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.
Indeed, thanks. Sorry for that!
5ad4694
to
cb8e011
Compare
Previously Chunks used size and ChunksMut used chunk_size
cb8e011
to
c096b3a
Compare
Also fixed another case of |
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.
Thanks!
@bors r+ rollup |
📌 Commit c096b3a has been approved by |
Minor cleanup for slice::Chunks and ChunksMut This only renames the `size` field to `chunk_size` in one of them for consistency, and changes an assertion to check for != 0 instead of > 0.
rust-lang#47113 renamed the private size field to chunk_size for consistency.
This only renames the
size
field tochunk_size
in one of them for consistency, and changes an assertion to check for != 0 instead of > 0.