Remove unnecessary rule enabled check (#9259)

This commit is contained in:
Charlie Marsh 2023-12-23 07:45:22 -05:00 committed by GitHub
parent 5040fb8cec
commit 506ffade6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,7 +7,6 @@ use ruff_text_size::{Ranged, TextRange};
use crate::checkers::ast::Checker;
use crate::fix::snippet::SourceCodeSnippet;
use crate::registry::AsRule;
/// ## What it does
/// Checks for uses of the known pre-Python 2.5 ternary syntax.
@ -123,11 +122,9 @@ pub(crate) fn and_or_ternary(checker: &mut Checker, bool_op: &ExprBoolOp) {
},
bool_op.range,
);
if checker.enabled(diagnostic.kind.rule()) {
diagnostic.set_fix(Fix::unsafe_edit(Edit::range_replacement(
ternary,
bool_op.range,
)));
}
diagnostic.set_fix(Fix::unsafe_edit(Edit::range_replacement(
ternary,
bool_op.range,
)));
checker.diagnostics.push(diagnostic);
}