@@ -278,7 +278,7 @@ impl<'a, T> DerefMut for MutSlice2<'a, T> {
278278 }
279279}
280280
281- mod inner {
281+ pub mod inner {
282282 use core:: fmt:: Formatter ;
283283 use core:: marker:: PhantomData ;
284284 use core:: ops:: { Deref , DerefMut , Index , IndexMut , Range } ;
@@ -290,6 +290,7 @@ mod inner {
290290 use super :: { AsSlice2 , MutSlice2 , Slice2 } ;
291291
292292 /// A helper type that abstracts over owned and borrowed buffers.
293+ ///
293294 /// The types `Buf2`, `Slice2`, and `MutSlice2` deref to `Inner`.
294295 #[ derive( Copy , Clone ) ]
295296 pub struct Inner < T , D > {
@@ -435,16 +436,18 @@ mod inner {
435436 }
436437
437438 /// Returns an iterator over the rows of `self` as `&[T]` slices.
439+ ///
438440 /// The length of each slice equals [`self.width()`](Self::width).
439441 pub fn rows ( & self ) -> impl Iterator < Item = & [ T ] > {
440442 self . data
441443 . chunks ( self . stride as usize )
442444 . map ( |row| & row[ ..self . dims . 0 as usize ] )
443445 }
444446
445- /// Returns an iterator over all the elements of `self` in row-major
446- /// order: first the elements on row 0 from left to right, followed
447- /// by the elements on row 1, and so on.
447+ /// Returns an iterator over all the elements of `self` in row-major order.
448+ ///
449+ /// First returns the elements on row 0 from left to right, followed by the elements
450+ /// on row 1, and so on.
448451 pub fn iter ( & self ) -> impl Iterator < Item = & ' _ T > {
449452 self . rows ( ) . flatten ( )
450453 }
@@ -455,11 +458,14 @@ mod inner {
455458 pub fn as_mut_slice2 ( & mut self ) -> MutSlice2 < T > {
456459 MutSlice2 :: new ( self . dims , self . stride , & mut self . data )
457460 }
461+
458462 /// Returns the data of `self` as a single mutable slice.
459463 pub ( super ) fn data_mut ( & mut self ) -> & mut [ T ] {
460464 & mut self . data
461465 }
462- /// Returns an iterator over the rows of this buffer as &mut [T].
466+
467+ /// Returns an iterator over the rows of this buffer as `&mut [T]`.
468+ ///
463469 /// The length of each slice equals [`self.width()`](Self::width).
464470 pub fn rows_mut ( & mut self ) -> impl Iterator < Item = & mut [ T ] > {
465471 self . data
0 commit comments