ruff/crates/ruff_python_formatter/src/other/bytes_literal.rs
2024-10-09 07:25:40 +01:00

15 lines
412 B
Rust

use ruff_python_ast::BytesLiteral;
use crate::prelude::*;
use crate::string::StringNormalizer;
#[derive(Default)]
pub struct FormatBytesLiteral;
impl FormatNodeRule<BytesLiteral> for FormatBytesLiteral {
fn fmt_fields(&self, item: &BytesLiteral, f: &mut PyFormatter) -> FormatResult<()> {
StringNormalizer::from_context(f.context())
.normalize(item.into())
.fmt(f)
}
}