Skip to content

Commit 017542a

Browse files
committed
FIX: Make internal iterator types and functions pub(crate)
These `pub` here actually predate the pub(crate) feature, and they should just be `pub(crate)` or lower since they are unreachable outside the crate.
1 parent fc3f836 commit 017542a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/iterators/mod.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use std::slice::{self, Iter as SliceIter, IterMut as SliceIterMut};
3232
/// Base for iterators over all axes.
3333
///
3434
/// Iterator element type is `*mut A`.
35-
pub struct Baseiter<A, D> {
35+
pub(crate) struct Baseiter<A, D> {
3636
ptr: *mut A,
3737
dim: D,
3838
strides: D,
@@ -319,7 +319,7 @@ pub struct Iter<'a, A, D> {
319319
}
320320

321321
/// Counted read only iterator
322-
pub struct ElementsBase<'a, A, D> {
322+
pub(crate) struct ElementsBase<'a, A, D> {
323323
inner: Baseiter<A, D>,
324324
life: PhantomData<&'a A>,
325325
}
@@ -336,7 +336,7 @@ pub struct IterMut<'a, A, D> {
336336
/// An iterator over the elements of an array.
337337
///
338338
/// Iterator element type is `&'a mut A`.
339-
pub struct ElementsBaseMut<'a, A, D> {
339+
pub(crate) struct ElementsBaseMut<'a, A, D> {
340340
inner: Baseiter<A, D>,
341341
life: PhantomData<&'a mut A>,
342342
}
@@ -765,7 +765,7 @@ where
765765
}
766766

767767
#[derive(Debug)]
768-
pub struct AxisIterCore<A, D> {
768+
struct AxisIterCore<A, D> {
769769
/// Index along the axis of the value of `.next()`, relative to the start
770770
/// of the axis.
771771
index: Ix,
@@ -1443,7 +1443,7 @@ send_sync_read_write!(ElementsBaseMut);
14431443
///
14441444
/// The iterator must produce exactly the number of elements it reported or
14451445
/// diverge before reaching the end.
1446-
pub unsafe trait TrustedIterator {}
1446+
pub(crate) unsafe trait TrustedIterator {}
14471447

14481448
use crate::indexes::IndicesIterF;
14491449
use crate::iter::IndicesIter;
@@ -1467,15 +1467,15 @@ unsafe impl<D> TrustedIterator for IndicesIter<D> where D: Dimension {}
14671467
unsafe impl<D> TrustedIterator for IndicesIterF<D> where D: Dimension {}
14681468

14691469
/// Like Iterator::collect, but only for trusted length iterators
1470-
pub fn to_vec<I>(iter: I) -> Vec<I::Item>
1470+
pub(crate) fn to_vec<I>(iter: I) -> Vec<I::Item>
14711471
where
14721472
I: TrustedIterator + ExactSizeIterator,
14731473
{
14741474
to_vec_mapped(iter, |x| x)
14751475
}
14761476

14771477
/// Like Iterator::collect, but only for trusted length iterators
1478-
pub fn to_vec_mapped<I, F, B>(iter: I, mut f: F) -> Vec<B>
1478+
pub(crate) fn to_vec_mapped<I, F, B>(iter: I, mut f: F) -> Vec<B>
14791479
where
14801480
I: TrustedIterator + ExactSizeIterator,
14811481
F: FnMut(I::Item) -> B,

0 commit comments

Comments
 (0)