We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c8c1b63 commit cbf7f51Copy full SHA for cbf7f51
gix-blame/src/file/function.rs
@@ -232,7 +232,7 @@ where
232
std::collections::BTreeMap::<ObjectId, Vec<Range<u32>>>::new(),
233
|mut acc, hunk| {
234
for (suspect, range) in hunk.suspects.clone() {
235
- acc.entry(suspect).or_insert(Vec::new()).push(range);
+ acc.entry(suspect).or_default().push(range);
236
}
237
238
acc
@@ -243,11 +243,8 @@ where
243
ranges.sort_by(|a, b| a.start.cmp(&b.start));
244
245
for window in ranges.windows(2) {
246
- match window {
247
- [a, b] => {
248
- assert!(a.end <= b.start, "#{hunks_to_blame:#?}");
249
- }
250
- _ => {}
+ if let [a, b] = window {
+ assert!(a.end <= b.start, "#{hunks_to_blame:#?}");
251
252
253
0 commit comments