From 8a77d280bdc2ffd578c7e8a76305c7bd025afece Mon Sep 17 00:00:00 2001 From: harupy Date: Wed, 2 Aug 2023 16:44:21 +0900 Subject: [PATCH] Fix arg_auto --- crates/ruff/src/rules/pyupgrade/rules/f_strings.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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> {