Skip to content

Commit 19eb1ab

Browse files
authored
Merge pull request #719 from jturner314/rm-multislice
Remove multislice! macro
2 parents dad7c4a + 1b6a2ad commit 19eb1ab

File tree

4 files changed

+6
-549
lines changed

4 files changed

+6
-549
lines changed

src/dimension/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ fn slice_min_max(axis_len: usize, slice: Slice) -> Option<(usize, usize)> {
545545
}
546546

547547
/// Returns `true` iff the slices intersect.
548-
#[doc(hidden)]
548+
#[allow(dead_code)]
549549
pub fn slices_intersect<D: Dimension>(
550550
dim: &D,
551551
indices1: &D::SliceArg,

src/lib.rs

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -118,18 +118,13 @@ use std::marker::PhantomData;
118118
use std::sync::Arc;
119119

120120
pub use crate::dimension::dim::*;
121-
pub use crate::dimension::{
122-
slices_intersect, Axis, AxisDescription, Dimension, IntoDimension, RemoveAxis,
123-
};
121+
pub use crate::dimension::{Axis, AxisDescription, Dimension, IntoDimension, RemoveAxis};
124122

125123
pub use crate::dimension::IxDynImpl;
126124
pub use crate::dimension::NdIndex;
127125
pub use crate::error::{ErrorKind, ShapeError};
128126
pub use crate::indexes::{indices, indices_of};
129-
pub use crate::slice::{
130-
deref_raw_view_mut_into_view_mut_with_life, deref_raw_view_mut_into_view_with_life,
131-
life_of_view_mut, Slice, SliceInfo, SliceNextDim, SliceOrIndex,
132-
};
127+
pub use crate::slice::{Slice, SliceInfo, SliceNextDim, SliceOrIndex};
133128

134129
use crate::iterators::Baseiter;
135130
use crate::iterators::{ElementsBase, ElementsBaseMut, Iter, IterMut, Lanes, LanesMut};
@@ -478,13 +473,10 @@ pub type Ixs = isize;
478473
/// [`.slice_move()`]: #method.slice_move
479474
/// [`.slice_collapse()`]: #method.slice_collapse
480475
///
481-
/// It's possible to take multiple simultaneous *mutable* slices with the
482-
/// [`multislice!()`](macro.multislice!.html) macro.
483-
///
484476
/// ```
485477
/// extern crate ndarray;
486478
///
487-
/// use ndarray::{arr2, arr3, multislice, s};
479+
/// use ndarray::{arr2, arr3, s};
488480
///
489481
/// fn main() {
490482
///
@@ -531,20 +523,6 @@ pub type Ixs = isize;
531523
/// [12, 11, 10]]);
532524
/// assert_eq!(f, g);
533525
/// assert_eq!(f.shape(), &[2, 3]);
534-
///
535-
/// // Let's take two disjoint, mutable slices of a matrix with
536-
/// //
537-
/// // - One containing all the even-index columns in the matrix
538-
/// // - One containing all the odd-index columns in the matrix
539-
/// let mut h = arr2(&[[0, 1, 2, 3],
540-
/// [4, 5, 6, 7]]);
541-
/// let (s0, s1) = multislice!(h, mut [.., ..;2], mut [.., 1..;2]);
542-
/// let i = arr2(&[[0, 2],
543-
/// [4, 6]]);
544-
/// let j = arr2(&[[1, 3],
545-
/// [5, 7]]);
546-
/// assert_eq!(s0, i);
547-
/// assert_eq!(s1, j);
548526
/// }
549527
/// ```
550528
///

0 commit comments

Comments
 (0)