explicitly implement count method for Accumulate

This commit is contained in:
2022-08-06 20:58:14 +02:00
parent 05590e8a3c
commit 8a0dfef53c
+5
View File
@@ -43,6 +43,11 @@ where
fn size_hint(&self) -> (usize, Option<usize>) { fn size_hint(&self) -> (usize, Option<usize>) {
self.iter.size_hint() self.iter.size_hint()
} }
#[inline]
fn count(self) -> usize {
self.iter.count()
}
} }
/// An [`Iterator`] blanket implementation that provides the [`accumulate()`](Self::accumulate) /// An [`Iterator`] blanket implementation that provides the [`accumulate()`](Self::accumulate)