diff --git a/crates/ruff_python_formatter/src/module/mod_module.rs b/crates/ruff_python_formatter/src/module/mod_module.rs index fe21ed65fa..0d0fee7c00 100644 --- a/crates/ruff_python_formatter/src/module/mod_module.rs +++ b/crates/ruff_python_formatter/src/module/mod_module.rs @@ -9,10 +9,17 @@ pub struct FormatModModule; impl FormatNodeRule for FormatModModule { fn fmt_fields(&self, item: &ModModule, f: &mut PyFormatter) -> FormatResult<()> { + let ModModule { + range: _, + body, + type_ignores, + } = item; + // https://docs.python.org/3/library/ast.html#ast-helpers + debug_assert!(type_ignores.is_empty()); write!( f, [ - item.body.format().with_options(SuiteLevel::TopLevel), + body.format().with_options(SuiteLevel::TopLevel), // Trailing newline at the end of the file hard_line_break() ]