## Summary We don't use `ModExpression` anywhere but it's part of the AST, removes one `not_implemented_yet` and is a trivial 2-liner, so i implemented formatting for `ModExpression`. ## Test Plan None, this kind of node does not occur in file input. Otherwise all the tests for expressions
14 lines
433 B
Rust
14 lines
433 B
Rust
use crate::{AsFormat, FormatNodeRule, PyFormatter};
|
|
use ruff_formatter::{Format, FormatResult};
|
|
use rustpython_parser::ast::ModExpression;
|
|
|
|
#[derive(Default)]
|
|
pub struct FormatModExpression;
|
|
|
|
impl FormatNodeRule<ModExpression> for FormatModExpression {
|
|
fn fmt_fields(&self, item: &ModExpression, f: &mut PyFormatter) -> FormatResult<()> {
|
|
let ModExpression { body, range: _ } = item;
|
|
body.format().fmt(f)
|
|
}
|
|
}
|