Skip to content

Commit 1a8377e

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 77332b1 commit 1a8377e

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/iterators/mod.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ use std::slice::{self, Iter as SliceIter, IterMut as SliceIterMut};
3636
///
3737
/// Iterator element type is `*mut A`.
3838
#[derive(Debug)]
39-
pub struct Baseiter<A, D>
39+
pub(crate) struct Baseiter<A, D>
4040
{
4141
ptr: *mut A,
4242
dim: D,
@@ -341,7 +341,7 @@ pub struct Iter<'a, A, D>
341341

342342
/// Counted read only iterator
343343
#[derive(Debug)]
344-
pub struct ElementsBase<'a, A, D>
344+
pub(crate) struct ElementsBase<'a, A, D>
345345
{
346346
inner: Baseiter<A, D>,
347347
life: PhantomData<&'a A>,
@@ -362,7 +362,7 @@ pub struct IterMut<'a, A, D>
362362
///
363363
/// Iterator element type is `&'a mut A`.
364364
#[derive(Debug)]
365-
pub struct ElementsBaseMut<'a, A, D>
365+
pub(crate) struct ElementsBaseMut<'a, A, D>
366366
{
367367
inner: Baseiter<A, D>,
368368
life: PhantomData<&'a mut A>,
@@ -829,7 +829,7 @@ impl<'a, A> DoubleEndedIterator for LanesIterMut<'a, A, Ix1>
829829
}
830830

831831
#[derive(Debug)]
832-
pub struct AxisIterCore<A, D>
832+
struct AxisIterCore<A, D>
833833
{
834834
/// Index along the axis of the value of `.next()`, relative to the start
835835
/// of the axis.
@@ -1532,8 +1532,7 @@ send_sync_read_write!(ElementsBaseMut);
15321532
///
15331533
/// The iterator must produce exactly the number of elements it reported or
15341534
/// diverge before reaching the end.
1535-
#[allow(clippy::missing_safety_doc)] // not nameable downstream
1536-
pub unsafe trait TrustedIterator {}
1535+
pub(crate) unsafe trait TrustedIterator {}
15371536

15381537
use crate::indexes::IndicesIterF;
15391538
use crate::iter::IndicesIter;
@@ -1558,14 +1557,14 @@ unsafe impl<D> TrustedIterator for IndicesIterF<D> where D: Dimension {}
15581557
unsafe impl<A, D> TrustedIterator for IntoIter<A, D> where D: Dimension {}
15591558

15601559
/// Like Iterator::collect, but only for trusted length iterators
1561-
pub fn to_vec<I>(iter: I) -> Vec<I::Item>
1560+
pub(crate) fn to_vec<I>(iter: I) -> Vec<I::Item>
15621561
where I: TrustedIterator + ExactSizeIterator
15631562
{
15641563
to_vec_mapped(iter, |x| x)
15651564
}
15661565

15671566
/// Like Iterator::collect, but only for trusted length iterators
1568-
pub fn to_vec_mapped<I, F, B>(iter: I, mut f: F) -> Vec<B>
1567+
pub(crate) fn to_vec_mapped<I, F, B>(iter: I, mut f: F) -> Vec<B>
15691568
where
15701569
I: TrustedIterator + ExactSizeIterator,
15711570
F: FnMut(I::Item) -> B,

0 commit comments

Comments
 (0)