Skip to content

Commit 98b2819

Browse files
fix CI
1 parent 85da253 commit 98b2819

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

futures-util/src/stream/mapped_futures/iter.rs

+9-6
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ pub struct IntoIter<K: Hash + Eq, Fut: Unpin> {
3838
pub(super) inner: MappedFutures<K, Fut>,
3939
}
4040

41+
/// Immutable iterator over all keys in the mapping.
42+
#[derive(Debug)]
43+
pub struct Keys<'a, K: Hash + Eq, Fut> {
44+
pub(super) inner: std::iter::Map<
45+
std::collections::hash_set::Iter<'a, HashTask<K, Fut>>,
46+
Box<dyn FnMut(&'a HashTask<K, Fut>) -> &'a K>,
47+
>,
48+
}
49+
4150
impl<K: Hash + Eq, Fut: Unpin> Iterator for IntoIter<K, Fut> {
4251
type Item = Fut;
4352

@@ -161,12 +170,6 @@ impl<'a, K: Hash + Eq, Fut: Unpin> Iterator for Iter<'a, K, Fut> {
161170

162171
impl<K: Hash + Eq, Fut: Unpin> ExactSizeIterator for Iter<'_, K, Fut> {}
163172

164-
pub struct Keys<'a, K: Hash + Eq, Fut> {
165-
pub(super) inner: std::iter::Map<
166-
std::collections::hash_set::Iter<'a, HashTask<K, Fut>>,
167-
Box<dyn FnMut(&'a HashTask<K, Fut>) -> &'a K>,
168-
>,
169-
}
170173
impl<K: Hash + Eq, Fut: Unpin> ExactSizeIterator for Keys<'_, K, Fut> {}
171174

172175
impl<'a, K: Hash + Eq, Fut> Iterator for Keys<'a, K, Fut> {

futures-util/src/stream/mapped_futures/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ impl<K: Hash + Eq, Fut> MappedFutures<K, Fut> {
309309
None
310310
}
311311

312+
/// Returns an iterator of keys in the mapping.
312313
pub fn keys<'a>(&'a self) -> Keys<'a, K, Fut> {
313314
Keys {
314315
inner: self.hash_set.iter().map(Box::new(|hash_task| HashTask::key_unwrap(hash_task))),

0 commit comments

Comments
 (0)