Skip to content

Commit 20844f1

Browse files
jturner314bluss
authored andcommitted
Add slice_axis_move method
1 parent 3492a9c commit 20844f1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/impl_methods.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,16 @@ where
656656
debug_assert!(self.pointer_is_inbounds());
657657
}
658658

659+
/// Slice the array in place along the specified axis, then return the sliced array.
660+
///
661+
/// **Panics** if an index is out of bounds or step size is zero.<br>
662+
/// **Panics** if `axis` is out of bounds.
663+
#[must_use = "slice_axis_move returns an array with the sliced result"]
664+
pub fn slice_axis_move(mut self, axis: Axis, indices: Slice) -> Self {
665+
self.slice_axis_inplace(axis, indices);
666+
self
667+
}
668+
659669
/// Return a view of a slice of the array, with a closure specifying the
660670
/// slice for each axis.
661671
///

0 commit comments

Comments
 (0)