Skip to content

Commit 7ab4d6c

Browse files
committed
(fixup) Flip control flow to avoid unnecessary boolean not
and satifsy clippy
1 parent cdb89eb commit 7ab4d6c

File tree

1 file changed

+3
-3
lines changed
  • crates/ruff_linter/src/checkers

1 file changed

+3
-3
lines changed

crates/ruff_linter/src/checkers/noqa.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,7 @@ pub(crate) fn check_noqa(
147147
break;
148148
}
149149

150-
if !seen_codes.insert(original_code) {
151-
duplicated_codes.push(original_code);
152-
} else {
150+
if seen_codes.insert(original_code) {
153151
let is_code_used = if is_file_level {
154152
diagnostics
155153
.iter()
@@ -172,6 +170,8 @@ pub(crate) fn check_noqa(
172170
} else {
173171
unknown_codes.push(original_code);
174172
}
173+
} else {
174+
duplicated_codes.push(original_code);
175175
}
176176
}
177177

0 commit comments

Comments
 (0)