Skip to content

Commit eb7d92a

Browse files
committed
Add slice_axis_move method
1 parent 6b5e829 commit eb7d92a

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
@@ -655,6 +655,16 @@ where
655655
debug_assert!(self.pointer_is_inbounds());
656656
}
657657

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

0 commit comments

Comments
 (0)