-
Notifications
You must be signed in to change notification settings - Fork 655
Open
Labels
Description
The size hint for chunks is computed as follows:
fn size_hint(&self) -> (usize, Option<usize>) {
let chunk_len = if self.items.is_empty() { 0 } else { 1 };
let (lower, upper) = self.stream.size_hint();
let lower = lower.saturating_add(chunk_len);
let upper = match upper {
Some(x) => x.checked_add(chunk_len),
None => None,
};
(lower, upper)
}
However, this is incorrect. The stream combines many items into one, so it should divide the size hints by the capacity.
taiki-e