Skip to content

Commit 8142bce

Browse files
committed
Edit docs for axis_iter, fix method order in the file so they are adjacent
1 parent 52e145f commit 8142bce

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

src/lib.rs

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,44 +1218,43 @@ impl<A, S, D> ArrayBase<S, D> where S: Data<Elem=A>, D: Dimension
12181218
iterators::new_outer_iter(self.view())
12191219
}
12201220

1221-
/// Return an iterator that traverses over the `axis` dimension
1221+
/// Return an iterator that traverses over the outermost dimension
12221222
/// and yields each subview.
12231223
///
1224+
/// Iterator element is `ArrayViewMut<A, D::Smaller>` (read-write array view).
1225+
pub fn outer_iter_mut(&mut self) -> OuterIterMut<A, D::Smaller>
1226+
where S: DataMut,
1227+
D: RemoveAxis,
1228+
{
1229+
iterators::new_outer_iter_mut(self.view_mut())
1230+
}
1231+
1232+
/// Return an iterator that traverses over `axis`
1233+
/// and yields each subview along it.
1234+
///
12241235
/// For example, in a 2 × 2 × 3 array, with `axis` equal to 1,
12251236
/// the iterator element
12261237
/// is a 2 × 2 subview (and there are 3 in total).
12271238
///
12281239
/// Iterator element is `ArrayView<A, D::Smaller>` (read-only array view).
12291240
///
1230-
/// # Panics
1241+
/// See [*Subviews*](#subviews) for full documentation.
12311242
///
1232-
/// If axis is out of bounds.
1243+
/// **Panics** if `axis` is out of bounds.
12331244
pub fn axis_iter(&self, axis: usize) -> OuterIter<A, D::Smaller>
12341245
where D: RemoveAxis
12351246
{
12361247
iterators::new_axis_iter(self.view(), axis)
12371248
}
12381249

1239-
/// Return an iterator that traverses over the outermost dimension
1240-
/// and yields each subview.
1241-
///
1242-
/// Iterator element is `ArrayViewMut<A, D::Smaller>` (read-write array view).
1243-
pub fn outer_iter_mut(&mut self) -> OuterIterMut<A, D::Smaller>
1244-
where S: DataMut,
1245-
D: RemoveAxis,
1246-
{
1247-
iterators::new_outer_iter_mut(self.view_mut())
1248-
}
12491250

1250-
/// Return an iterator that traverses over the `axis` dimension
1251-
/// and yields each mutable subview.
1251+
/// Return an iterator that traverses over `axis`
1252+
/// and yields each mutable subview along it.
12521253
///
12531254
/// Iterator element is `ArrayViewMut<A, D::Smaller>`
12541255
/// (read-write array view).
12551256
///
1256-
/// # Panics
1257-
///
1258-
/// If axis is out of bounds.
1257+
/// **Panics** if `axis` is out of bounds.
12591258
pub fn axis_iter_mut(&mut self, axis: usize) -> OuterIterMut<A, D::Smaller>
12601259
where S: DataMut,
12611260
D: RemoveAxis,

0 commit comments

Comments
 (0)