Skip to content

Commit 4f944c6

Browse files
committed
Merge pull request #27 from apasel422/update
document iterator structs
2 parents ca7cb20 + 86cfe44 commit 4f944c6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
//! assert_eq!(items, [(2, 20), (1, 10), (3, 30)]);
2929
//! ```
3030
31+
#![forbid(missing_docs)]
3132
#![feature(hashmap_hasher)]
3233
#![feature(box_raw)]
3334
#![feature(iter_order)]
@@ -718,13 +719,17 @@ impl<K, V, S> Drop for LinkedHashMap<K, V, S> {
718719
}
719720
}
720721

722+
/// An insertion-order iterator over a `LinkedHashMap`'s entries, with immutable references to the
723+
/// values.
721724
pub struct Iter<'a, K: 'a, V: 'a> {
722725
head: *const LinkedHashMapEntry<K, V>,
723726
tail: *const LinkedHashMapEntry<K, V>,
724727
remaining: usize,
725728
marker: marker::PhantomData<(&'a K, &'a V)>,
726729
}
727730

731+
/// An insertion-order iterator over a `LinkedHashMap`'s entries, with mutable references to the
732+
/// values.
728733
pub struct IterMut<'a, K: 'a, V: 'a> {
729734
head: *mut LinkedHashMapEntry<K, V>,
730735
tail: *mut LinkedHashMapEntry<K, V>,
@@ -817,6 +822,7 @@ impl<'a, K, V> ExactSizeIterator for IterMut<'a, K, V> {
817822
}
818823

819824

825+
/// An insertion-order iterator over a `LinkedHashMap`'s keys.
820826
pub struct Keys<'a, K: 'a, V: 'a> {
821827
inner: iter::Map<Iter<'a, K, V>, fn((&'a K, &'a V)) -> &'a K>
822828
}
@@ -841,6 +847,7 @@ impl<'a, K, V> ExactSizeIterator for Keys<'a, K, V> {
841847
}
842848

843849

850+
/// An insertion-order iterator over a `LinkedHashMap`'s values.
844851
pub struct Values<'a, K: 'a, V: 'a> {
845852
inner: iter::Map<Iter<'a, K, V>, fn((&'a K, &'a V)) -> &'a V>
846853
}

0 commit comments

Comments
 (0)