diff --git a/crates/ruff/src/rules/pyupgrade/rules/f_strings.rs b/crates/ruff/src/rules/pyupgrade/rules/f_strings.rs index 462b3c5f81f890..b40a330373d827 100644 --- a/crates/ruff/src/rules/pyupgrade/rules/f_strings.rs +++ b/crates/ruff/src/rules/pyupgrade/rules/f_strings.rs @@ -104,8 +104,9 @@ impl<'a> FormatSummaryValues<'a> { } fn arg_auto(&mut self) -> Option<&Expr> { + let arg = self.arg_positional(self.auto_index); self.auto_index += 1; - self.arg_positional(self.auto_index - 1) + arg } fn arg_positional(&mut self, index: usize) -> Option<&Expr> {