Skip to content

Commit d61ba3a

Browse files
bors[bot]jeandudey
andauthored
Merge #332
332: Export Iter from IndexSet and IndexMap r=korken89 a=jeandudey Exports the `Iter` types for `IndexSet` and `IndexMap`. My use case is having a trait generic over a `BTreeSet` and `IndexSet` which has a `type Iter`. Co-authored-by: Jean-Pierre De Jesus DIAZ <me@jeandudey.tech>
2 parents 44a609f + 837f322 commit d61ba3a

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2323
- [breaking-change] changed the target support of memory pool API to only support 32-bit x86 and a
2424
subset of ARM targets. See the module level documentation of the `pool` module for details
2525
- relax trait requirements on `IndexMap` and `IndexSet`.
26+
- export `IndexSet` and `IndexMap` iterator types.
2627

2728
- [breaking-change] this crate now depends on `atomic-polyfill` v1.0.1, meaning that targets that
2829
require a polyfill need a `critical-section` **v1.x.x** implementation.

src/indexmap.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,6 +1081,10 @@ impl<'a, K, V, S, const N: usize> IntoIterator for &'a mut IndexMap<K, V, S, N>
10811081
}
10821082
}
10831083

1084+
/// An iterator over the items of a [`IndexMap`].
1085+
///
1086+
/// This `struct` is created by the [`iter`](IndexMap::iter) method on [`IndexMap`]. See its
1087+
/// documentation for more.
10841088
pub struct Iter<'a, K, V> {
10851089
iter: slice::Iter<'a, Bucket<K, V>>,
10861090
}

src/indexset.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,10 @@ where
571571
}
572572
}
573573

574+
/// An iterator over the items of a [`IndexSet`].
575+
///
576+
/// This `struct` is created by the [`iter`](IndexSet::iter) method on [`IndexSet`]. See its
577+
/// documentation for more.
574578
pub struct Iter<'a, T> {
575579
iter: indexmap::Iter<'a, T, ()>,
576580
}

src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,10 @@
8282
pub use binary_heap::BinaryHeap;
8383
pub use deque::Deque;
8484
pub use histbuf::{HistoryBuffer, OldestOrdered};
85-
pub use indexmap::{Bucket, Entry, FnvIndexMap, IndexMap, OccupiedEntry, Pos, VacantEntry};
86-
pub use indexset::{FnvIndexSet, IndexSet};
85+
pub use indexmap::{
86+
Bucket, Entry, FnvIndexMap, IndexMap, Iter as IndexMapIter, OccupiedEntry, Pos, VacantEntry,
87+
};
88+
pub use indexset::{FnvIndexSet, IndexSet, Iter as IndexSetIter};
8789
pub use linear_map::LinearMap;
8890
pub use string::String;
8991
pub use vec::Vec;

0 commit comments

Comments
 (0)