Format StmtExpr (#4788)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use crate::{verbatim_text, FormatNodeRule, PyFormatter};
|
||||
use ruff_formatter::{write, Buffer, FormatResult};
|
||||
use crate::prelude::*;
|
||||
use crate::FormatNodeRule;
|
||||
use rustpython_parser::ast::StmtExpr;
|
||||
|
||||
#[derive(Default)]
|
||||
@@ -7,6 +7,8 @@ pub struct FormatStmtExpr;
|
||||
|
||||
impl FormatNodeRule<StmtExpr> for FormatStmtExpr {
|
||||
fn fmt_fields(&self, item: &StmtExpr, f: &mut PyFormatter) -> FormatResult<()> {
|
||||
write!(f, [verbatim_text(item.range)])
|
||||
let StmtExpr { value, .. } = item;
|
||||
|
||||
value.format().fmt(f)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user