Skip to content

Commit

Permalink
Remove unnecessary rule enabled check (astral-sh#9259)
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Dec 23, 2023
1 parent 5040fb8 commit 506ffad
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions crates/ruff_linter/src/rules/pylint/rules/and_or_ternary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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);
}

0 comments on commit 506ffad

Please sign in to comment.