Remove layout values from AnyStringPart (#13681)

This commit is contained in:
Micha Reiser 2024-10-09 08:25:40 +02:00 committed by GitHub
parent 93eff7f174
commit b9827a4122
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 45 additions and 62 deletions

View file

@ -9,7 +9,6 @@ pub struct FormatBytesLiteral;
impl FormatNodeRule<BytesLiteral> for FormatBytesLiteral {
fn fmt_fields(&self, item: &BytesLiteral, f: &mut PyFormatter) -> FormatResult<()> {
StringNormalizer::from_context(f.context())
.with_preferred_quote_style(f.options().quote_style())
.normalize(item.into())
.fmt(f)
}

View file

@ -40,9 +40,7 @@ impl Format<PyFormatContext<'_>> for FormatFString<'_> {
self.quoting
};
let normalizer = StringNormalizer::from_context(f.context())
.with_quoting(quoting)
.with_preferred_quote_style(f.options().quote_style());
let normalizer = StringNormalizer::from_context(f.context()).with_quoting(quoting);
// If f-string formatting is disabled (not in preview), then we will
// fall back to the previous behavior of normalizing the f-string.