Skip to content

Commit

Permalink
Merge pull request #1211 from jturner314/slice-axis-move
Browse files Browse the repository at this point in the history
Add slice_axis_move method
  • Loading branch information
bluss committed Mar 10, 2024
2 parents 8d5eac1 + 20844f1 commit c4db8e7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/impl_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,16 @@ where
debug_assert!(self.pointer_is_inbounds());
}

/// Slice the array in place along the specified axis, then return the sliced array.
///
/// **Panics** if an index is out of bounds or step size is zero.<br>
/// **Panics** if `axis` is out of bounds.
#[must_use = "slice_axis_move returns an array with the sliced result"]
pub fn slice_axis_move(mut self, axis: Axis, indices: Slice) -> Self {
self.slice_axis_inplace(axis, indices);
self
}

/// Return a view of a slice of the array, with a closure specifying the
/// slice for each axis.
///
Expand Down

0 comments on commit c4db8e7

Please sign in to comment.