From 506ffade6ca22867c007ecaed2dc63ad2d74147a Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Sat, 23 Dec 2023 07:45:22 -0500 Subject: [PATCH] Remove unnecessary rule enabled check (#9259) --- .../src/rules/pylint/rules/and_or_ternary.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/crates/ruff_linter/src/rules/pylint/rules/and_or_ternary.rs b/crates/ruff_linter/src/rules/pylint/rules/and_or_ternary.rs index ed7c2ef634..00f2b5194d 100644 --- a/crates/ruff_linter/src/rules/pylint/rules/and_or_ternary.rs +++ b/crates/ruff_linter/src/rules/pylint/rules/and_or_ternary.rs @@ -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); }