Skip to content

Commit

Permalink
used sum instead of fold.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sagebati committed Feb 10, 2020
1 parent c22c475 commit 15aafd5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2208,7 +2208,7 @@ pub trait Itertools: Iterator {
/// assert_eq!(
/// data.into_iter()
/// .into_group_map_by(|x| x.0)
/// .map(|(key, values)| (key, values.into_iter().fold(0,|acc, (_,v)| acc + v )))
/// .map(|(key, values)| (key, values.into_iter().sum()))
/// .collect::<HashMap<u32,u32>>()[&0], 30)
/// ```
#[cfg(feature = "use_std")]
Expand Down

0 comments on commit 15aafd5

Please sign in to comment.