refactor: Simplify quote selection logic (#13536)

This commit is contained in:
Micha Reiser 2024-09-27 14:40:28 +02:00 committed by GitHub
parent 253f5f269a
commit f3e464ea4c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 23 additions and 51 deletions

View file

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