Auto-fix clippy::collapsible_if violations (#36428)

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz
2025-08-19 13:27:24 +00:00
committed by GitHub
parent 9e8ec72bd5
commit 8f567383e4
281 changed files with 6625 additions and 7086 deletions
+14 -18
View File
@@ -3592,24 +3592,20 @@ fn assert_position_translation(snapshot: &MultiBufferSnapshot) {
for (anchors, bias) in [(&left_anchors, Bias::Left), (&right_anchors, Bias::Right)] {
for (ix, (offset, anchor)) in offsets.iter().zip(anchors).enumerate() {
if ix > 0 {
if *offset == 252 {
if offset > &offsets[ix - 1] {
let prev_anchor = left_anchors[ix - 1];
assert!(
anchor.cmp(&prev_anchor, snapshot).is_gt(),
"anchor({}, {bias:?}).cmp(&anchor({}, {bias:?}).is_gt()",
offsets[ix],
offsets[ix - 1],
);
assert!(
prev_anchor.cmp(anchor, snapshot).is_lt(),
"anchor({}, {bias:?}).cmp(&anchor({}, {bias:?}).is_lt()",
offsets[ix - 1],
offsets[ix],
);
}
}
if ix > 0 && *offset == 252 && offset > &offsets[ix - 1] {
let prev_anchor = left_anchors[ix - 1];
assert!(
anchor.cmp(&prev_anchor, snapshot).is_gt(),
"anchor({}, {bias:?}).cmp(&anchor({}, {bias:?}).is_gt()",
offsets[ix],
offsets[ix - 1],
);
assert!(
prev_anchor.cmp(anchor, snapshot).is_lt(),
"anchor({}, {bias:?}).cmp(&anchor({}, {bias:?}).is_lt()",
offsets[ix - 1],
offsets[ix],
);
}
}
}