diff --git a/src/optimize.rs b/src/optimize.rs index 3dee91c..bceca6a 100644 --- a/src/optimize.rs +++ b/src/optimize.rs @@ -332,8 +332,9 @@ impl> Iterator for Optimizer { /// Computes the total encoded length of all segments. pub fn total_encoded_len(segments: &[Segment], version: Version) -> usize { - // TODO revert to `.map().sum()` after `sum()` is stable. - segments.iter().fold(0, |acc, seg| acc + seg.encoded_len(version)) + segments.iter() + .map(|seg| seg.encoded_len(version)) + .sum() } #[cfg(test)]