mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-03 15:15:33 +00:00
refactor: Simplify quote selection logic (#13536)
This commit is contained in:
parent
253f5f269a
commit
f3e464ea4c
4 changed files with 23 additions and 51 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue