Auto-fix clippy::collapsible_if violations (#36428)
Release Notes: - N/A
This commit is contained in:
@@ -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],
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user