Skip to content

Commit

Permalink
Use or_default to simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
msk committed Nov 15, 2023
1 parent 0112592 commit fa5a046
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@ pub fn agenda<P: AsRef<Path>>(
let Some(username) = email_map.get(email) else {
continue;
};
let entry = stats
.entry(username.to_string())
.or_insert_with(IndividualStats::default);
let entry = stats.entry(username.to_string()).or_default();
entry.lines_contributed += loc;
}
for (username, stats) in stats {
Expand Down

0 comments on commit fa5a046

Please sign in to comment.