Skip to content

Commit c801c04

Browse files
committed
Restore iterator item type docs
1 parent 19d3a17 commit c801c04

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,28 +147,38 @@ impl<K: Eq, V> LinearMap<K, V> {
147147
///
148148
/// All key-value pairs are removed even if the iterator is not exhausted. However, the
149149
/// behavior of this method is unspecified if the iterator is leaked.
150+
///
151+
/// The iterator's item type is `(K, V)`.
150152
pub fn drain(&mut self) -> Drain<K, V> {
151153
Drain { iter: self.storage.drain(..) }
152154
}
153155

154156
/// Returns an iterator yielding references to the map's keys and their corresponding values in
155157
/// arbitrary order.
158+
///
159+
/// The iterator's item type is `(&K, &V)`.
156160
pub fn iter(&self) -> Iter<K, V> {
157161
Iter { iter: self.storage.iter() }
158162
}
159163

160164
/// Returns an iterator yielding references to the map's keys and mutable references to their
161165
/// corresponding values in arbitrary order.
166+
///
167+
/// The iterator's item type is `(&K, &mut V)`.
162168
pub fn iter_mut(&mut self) -> IterMut<K, V> {
163169
IterMut { iter: self.storage.iter_mut() }
164170
}
165171

166172
/// Returns an iterator yielding references to the map's keys in arbitrary order.
173+
///
174+
/// The iterator's item type is `&K`.
167175
pub fn keys(&self) -> Keys<K, V> {
168176
Keys { iter: self.iter() }
169177
}
170178

171179
/// Returns an iterator yielding references to the map's values in arbitrary order.
180+
///
181+
/// The iterator's item type is `&V`.
172182
pub fn values(&self) -> Values<K, V> {
173183
Values { iter: self.iter() }
174184
}

0 commit comments

Comments
 (0)