Add better size hints for notification iterators
This commit is contained in:
parent
0e1fa26b48
commit
487cbaf9c2
@ -117,6 +117,10 @@ impl<'a> Iterator for Iter<'a> {
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
||||
fn size_hint(&self) -> (usize, Option<usize>) {
|
||||
(self.conn.conn.borrow().notifications.len(), None)
|
||||
}
|
||||
}
|
||||
|
||||
/// An iterator over notifications which will block if none are pending.
|
||||
@ -190,4 +194,8 @@ impl<'a> Iterator for TimeoutIter<'a> {
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
||||
fn size_hint(&self) -> (usize, Option<usize>) {
|
||||
(self.conn.conn.borrow().notifications.len(), None)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user