diff --git a/crates/ruff_python_literal/src/format.rs b/crates/ruff_python_literal/src/format.rs index 2e2364e218..673ce5cf9e 100644 --- a/crates/ruff_python_literal/src/format.rs +++ b/crates/ruff_python_literal/src/format.rs @@ -320,7 +320,7 @@ fn parse_precision(text: &str) -> Result<(Option, &str), FormatSpecError> /// Parses a format part within a format spec fn parse_nested_placeholder<'a>( - parts: &mut Vec, + placeholders: &mut Vec, text: &'a str, ) -> Result<&'a str, FormatSpecError> { match FormatString::parse_spec(text, AllowPlaceholderNesting::No) { @@ -328,7 +328,7 @@ fn parse_nested_placeholder<'a>( Err(FormatParseError::MissingStartBracket) => Ok(text), Err(err) => Err(FormatSpecError::InvalidPlaceholder(err)), Ok((format_part, text)) => { - parts.push(format_part); + placeholders.push(format_part); Ok(text) } } @@ -337,7 +337,6 @@ fn parse_nested_placeholder<'a>( impl FormatSpec { pub fn parse(text: &str) -> Result { let mut replacements = vec![]; - // get_integer in CPython let text = parse_nested_placeholder(&mut replacements, text)?; let (conversion, text) = FormatConversion::parse(text); let text = parse_nested_placeholder(&mut replacements, text)?;