Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
radicle: Implement Iterator::size_hint() for optimizations
Matthias Beyer committed 8 months ago
commit b49ff9e5af6d6535b8c0a9b04f8f968d981af921
parent 1e66c576434abd1f121dec1eccb183542ae18c09
1 file changed +8 -0
modified crates/radicle/src/cob/issue/cache.rs
@@ -371,6 +371,10 @@ impl Iterator for NoCacheIter<'_> {
    fn next(&mut self) -> Option<Self::Item> {
        self.inner.next()
    }
+

+
    fn size_hint(&self) -> (usize, Option<usize>) {
+
        self.inner.size_hint()
+
    }
}

impl<R> Issues for Cache<super::Issues<'_, R>, cache::NoCache>
@@ -449,6 +453,10 @@ impl Iterator for IssuesIter<'_> {
        let row = self.inner.next()?;
        Some(row.map_err(Error::from).and_then(IssuesIter::parse_row))
    }
+

+
    fn size_hint(&self) -> (usize, Option<usize>) {
+
        self.inner.size_hint()
+
    }
}

impl<R> Issues for Cache<R, StoreWriter>