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