Skip to content

Commit

Permalink
Follow clippy suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Jan 9, 2025
1 parent c8c1b63 commit cbf7f51
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions gix-blame/src/file/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ where
std::collections::BTreeMap::<ObjectId, Vec<Range<u32>>>::new(),
|mut acc, hunk| {
for (suspect, range) in hunk.suspects.clone() {
acc.entry(suspect).or_insert(Vec::new()).push(range);
acc.entry(suspect).or_default().push(range);
}

acc
Expand All @@ -243,11 +243,8 @@ where
ranges.sort_by(|a, b| a.start.cmp(&b.start));

for window in ranges.windows(2) {
match window {
[a, b] => {
assert!(a.end <= b.start, "#{hunks_to_blame:#?}");
}
_ => {}
if let [a, b] = window {
assert!(a.end <= b.start, "#{hunks_to_blame:#?}");
}
}
}
Expand Down

0 comments on commit cbf7f51

Please sign in to comment.