Skip to content

Commit 8101587

Browse files
committed
matches: Improve naming. NFC.
1 parent 4aee3b1 commit 8101587

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

clippy_lints/src/matches.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -942,28 +942,30 @@ fn form_exhaustive_matches(left: &Pat<'_>, right: &Pat<'_>) -> bool {
942942
);
943943
let mut left_pos = left_pos.unwrap_or(usize::MAX);
944944
let mut right_pos = right_pos.unwrap_or(usize::MAX);
945-
let mut left_span = 0;
946-
let mut right_span = 0;
945+
let mut left_dot_space = 0;
946+
let mut right_dot_space = 0;
947947
for i in 0..len {
948948
let mut found_dotdot = false;
949949
if i == left_pos {
950-
left_span += 1;
951-
if left_span < len - left_in.len() {
950+
left_dot_space += 1;
951+
if left_dot_space < len - left_in.len() {
952952
left_pos += 1;
953953
}
954954
found_dotdot = true;
955955
}
956956
if i == right_pos {
957-
right_span += 1;
958-
if right_span < len - right_in.len() {
957+
right_dot_space += 1;
958+
if right_dot_space < len - right_in.len() {
959959
right_pos += 1;
960960
}
961961
found_dotdot = true;
962962
}
963963
if found_dotdot {
964964
continue;
965965
}
966-
if !contains_only_wilds(&left_in[i - left_span]) && !contains_only_wilds(&right_in[i - right_span]) {
966+
if !contains_only_wilds(&left_in[i - left_dot_space])
967+
&& !contains_only_wilds(&right_in[i - right_dot_space])
968+
{
967969
return false;
968970
}
969971
}

0 commit comments

Comments
 (0)