Files
ruff/crates/ruff_python_formatter/src/module/mod_expression.rs
konsti 62a24e1028 Format ModExpression (#5689)
## 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
2023-07-11 16:41:10 +02:00

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)
}
}