From e86dd7d0cb26e272611ed74164b5fb92d6a7548d Mon Sep 17 00:00:00 2001 From: PLR <51248199+plredmond@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:42:23 -0700 Subject: [PATCH] [ruff UP031, issue #10187] cargo clippy --- .../src/rules/pyupgrade/rules/printf_string_formatting.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/ruff_linter/src/rules/pyupgrade/rules/printf_string_formatting.rs b/crates/ruff_linter/src/rules/pyupgrade/rules/printf_string_formatting.rs index 7dd9c1a13d..4f3161b21d 100644 --- a/crates/ruff_linter/src/rules/pyupgrade/rules/printf_string_formatting.rs +++ b/crates/ruff_linter/src/rules/pyupgrade/rules/printf_string_formatting.rs @@ -325,20 +325,19 @@ fn clean_params_variable<'a>(checker: &mut Checker, right: &Expr) -> Option { - return Some(Cow::Owned(format!("({}[0])", rt))); + return Some(Cow::Owned(format!("({rt}[0])"))); } // non-tuple _ => { - return Some(Cow::Owned(format!("({})", rt))); + return Some(Cow::Owned(format!("({rt})"))); } } } // when find_binding_value doesn't work, fall back to offering a fix only for non-tuples if analyze::typing::is_tuple(binding, semantic) { return None; - } else { - return Some(Cow::Owned(format!("({})", rt))); } + return Some(Cow::Owned(format!("({rt})"))); } /// Returns `true` if the sequence of [`PercentFormatPart`] indicate that an