mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-15 13:36:49 +00:00
Indenting for modules
rustfmt now bootstraps!
This commit is contained in:
parent
daff43f761
commit
c00970f5e9
@ -135,6 +135,11 @@ impl<'a, 'v> visit::Visitor<'v> for FmtVisitor<'a> {
|
||||
visit::walk_item(self, item);
|
||||
self.block_indent -= TAB_SPACES;
|
||||
}
|
||||
ast::Item_::ItemMod(_) => {
|
||||
self.block_indent += TAB_SPACES;
|
||||
visit::walk_item(self, item);
|
||||
self.block_indent -= TAB_SPACES;
|
||||
}
|
||||
_ => {
|
||||
visit::walk_item(self, item);
|
||||
}
|
||||
|
15
tests/idem/mod-1.rs
Normal file
15
tests/idem/mod-1.rs
Normal file
@ -0,0 +1,15 @@
|
||||
// Deeply indented modules.
|
||||
|
||||
mod foo {
|
||||
mod bar {
|
||||
mod baz {
|
||||
fn foo() {
|
||||
bar()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mod qux {
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user