Skip to content

Commit

Permalink
Rename MultiSlice to MultiSliceArg
Browse files Browse the repository at this point in the history
  • Loading branch information
jturner314 authored and bluss committed Mar 12, 2021
1 parent 87515c6 commit c4efbbf
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
9 changes: 5 additions & 4 deletions src/impl_methods.rs
Expand Up @@ -32,7 +32,7 @@ use crate::iter::{
AxisChunksIter, AxisChunksIterMut, AxisIter, AxisIterMut, ExactChunks, ExactChunksMut,
IndexedIter, IndexedIterMut, Iter, IterMut, Lanes, LanesMut, Windows,
};
use crate::slice::{MultiSlice, SliceArg};
use crate::slice::{MultiSliceArg, SliceArg};
use crate::stacking::concatenate;
use crate::{AxisSliceInfo, NdIndex, Slice};

Expand Down Expand Up @@ -363,8 +363,9 @@ where

/// Return multiple disjoint, sliced, mutable views of the array.
///
/// See [*Slicing*](#slicing) for full documentation.
/// See also [`s!`], [`SliceArg`], and [`SliceInfo`](crate::SliceInfo).
/// See [*Slicing*](#slicing) for full documentation. See also
/// [`MultiSliceArg`], [`s!`], [`SliceArg`], and
/// [`SliceInfo`](crate::SliceInfo).
///
/// **Panics** if any of the following occur:
///
Expand All @@ -385,7 +386,7 @@ where
/// ```
pub fn multi_slice_mut<'a, M>(&'a mut self, info: M) -> M::Output
where
M: MultiSlice<'a, A, D>,
M: MultiSliceArg<'a, A, D>,
S: DataMut,
{
info.multi_slice_move(self.view_mut())
Expand Down
9 changes: 5 additions & 4 deletions src/impl_views/splitting.rs
Expand Up @@ -7,7 +7,7 @@
// except according to those terms.

use crate::imp_prelude::*;
use crate::slice::MultiSlice;
use crate::slice::MultiSliceArg;

/// Methods for read-only array views.
impl<'a, A, D> ArrayView<'a, A, D>
Expand Down Expand Up @@ -117,8 +117,9 @@ where
/// consumes `self` and produces views with lifetimes matching that of
/// `self`.
///
/// See [*Slicing*](#slicing) for full documentation. See also [`s!`],
/// [`SliceArg`](crate::SliceArg), and [`SliceInfo`](crate::SliceInfo).
/// See [*Slicing*](#slicing) for full documentation. See also
/// [`MultiSliceArg`], [`s!`], [`SliceArg`](crate::SliceArg), and
/// [`SliceInfo`](crate::SliceInfo).
///
/// [`.multi_slice_mut()`]: struct.ArrayBase.html#method.multi_slice_mut
///
Expand All @@ -129,7 +130,7 @@ where
/// * if `D` is `IxDyn` and `info` does not match the number of array axes
pub fn multi_slice_move<M>(self, info: M) -> M::Output
where
M: MultiSlice<'a, A, D>,
M: MultiSliceArg<'a, A, D>,
{
info.multi_slice_move(self)
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Expand Up @@ -142,7 +142,7 @@ pub use crate::dimension::NdIndex;
pub use crate::error::{ErrorKind, ShapeError};
pub use crate::indexes::{indices, indices_of};
pub use crate::slice::{
AxisSliceInfo, MultiSlice, NewAxis, Slice, SliceArg, SliceInfo, SliceNextDim,
AxisSliceInfo, MultiSliceArg, NewAxis, Slice, SliceArg, SliceInfo, SliceNextDim,
};

use crate::iterators::Baseiter;
Expand Down
12 changes: 6 additions & 6 deletions src/slice.rs
Expand Up @@ -904,7 +904,7 @@ macro_rules! s(
///
/// It's unfortunate that we need `'a` and `A` to be parameters of the trait,
/// but they're necessary until Rust supports generic associated types.
pub trait MultiSlice<'a, A, D>
pub trait MultiSliceArg<'a, A, D>
where
A: 'a,
D: Dimension,
Expand All @@ -921,7 +921,7 @@ where
private_decl! {}
}

impl<'a, A, D> MultiSlice<'a, A, D> for ()
impl<'a, A, D> MultiSliceArg<'a, A, D> for ()
where
A: 'a,
D: Dimension,
Expand All @@ -933,7 +933,7 @@ where
private_impl! {}
}

impl<'a, A, D, I0> MultiSlice<'a, A, D> for (&I0,)
impl<'a, A, D, I0> MultiSliceArg<'a, A, D> for (&I0,)
where
A: 'a,
D: Dimension,
Expand All @@ -953,7 +953,7 @@ macro_rules! impl_multislice_tuple {
impl_multislice_tuple!(@def_impl ($($but_last,)* $last,), [$($but_last)*] $last);
};
(@def_impl ($($all:ident,)*), [$($but_last:ident)*] $last:ident) => {
impl<'a, A, D, $($all,)*> MultiSlice<'a, A, D> for ($(&$all,)*)
impl<'a, A, D, $($all,)*> MultiSliceArg<'a, A, D> for ($(&$all,)*)
where
A: 'a,
D: Dimension,
Expand Down Expand Up @@ -995,11 +995,11 @@ impl_multislice_tuple!([I0 I1 I2] I3);
impl_multislice_tuple!([I0 I1 I2 I3] I4);
impl_multislice_tuple!([I0 I1 I2 I3 I4] I5);

impl<'a, A, D, T> MultiSlice<'a, A, D> for &T
impl<'a, A, D, T> MultiSliceArg<'a, A, D> for &T
where
A: 'a,
D: Dimension,
T: MultiSlice<'a, A, D>,
T: MultiSliceArg<'a, A, D>,
{
type Output = T::Output;

Expand Down

0 comments on commit c4efbbf

Please sign in to comment.