about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-01-03 16:57:57 +0800
committerGitHub <noreply@github.com>2018-01-03 16:57:57 +0800
commit219e72c9085f245aca72f7d105590b6e5a089fb9 (patch)
treee2497e3e2ecb8337deb4a833197131a2184bcdcb /src/liballoc
parentdd0b70e3fe80d6c48b6522dda6fe8809cea0405a (diff)
parentc096b3a451b38a84d3168bd2f4ce10a37d61e1ab (diff)
downloadrust-219e72c9085f245aca72f7d105590b6e5a089fb9.tar.gz
rust-219e72c9085f245aca72f7d105590b6e5a089fb9.zip
Rollup merge of #47113 - sdroege:chunks-size-field, r=dtolnay
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.
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/slice.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/liballoc/slice.rs b/src/liballoc/slice.rs
index ab574c9f7e7..b880616833a 100644
--- a/src/liballoc/slice.rs
+++ b/src/liballoc/slice.rs
@@ -606,14 +606,14 @@ impl<T> [T] {
         core_slice::SliceExt::windows(self, size)
     }
 
-    /// Returns an iterator over `size` elements of the slice at a
-    /// time. The chunks are slices and do not overlap. If `size` does
+    /// Returns an iterator over `chunk_size` elements of the slice at a
+    /// time. The chunks are slices and do not overlap. If `chunk_size` does
     /// not divide the length of the slice, then the last chunk will
-    /// not have length `size`.
+    /// not have length `chunk_size`.
     ///
     /// # Panics
     ///
-    /// Panics if `size` is 0.
+    /// Panics if `chunk_size` is 0.
     ///
     /// # Examples
     ///
@@ -627,8 +627,8 @@ impl<T> [T] {
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]
     #[inline]
-    pub fn chunks(&self, size: usize) -> Chunks<T> {
-        core_slice::SliceExt::chunks(self, size)
+    pub fn chunks(&self, chunk_size: usize) -> Chunks<T> {
+        core_slice::SliceExt::chunks(self, chunk_size)
     }
 
     /// Returns an iterator over `chunk_size` elements of the slice at a time.