Replaced .fold(0, add) by .sum()

This commit is contained in:
johannesd3 2021-01-25 20:56:22 +01:00
parent 07514c9dcc
commit c97fdeb3b4

View file

@ -54,7 +54,7 @@ impl RangeSet {
} }
pub fn len(&self) -> usize { pub fn len(&self) -> usize {
self.ranges.iter().map(|r| r.length).fold(0, std::ops::Add::add) self.ranges.iter().map(|r| r.length).sum()
} }
pub fn get_range(&self, index: usize) -> Range { pub fn get_range(&self, index: usize) -> Range {