Skip to content

Commit bcaf761

Browse files
committed
Only reorder module declarations
e.g. `mod foo`;
1 parent 3eb4ba0 commit bcaf761

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rustfmt-core/src/reorder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ impl ReorderableItemKind {
233233
match item.node {
234234
_ if contains_macro_use_attr(item) => ReorderableItemKind::Other,
235235
ast::ItemKind::ExternCrate(..) => ReorderableItemKind::ExternCrate,
236-
ast::ItemKind::Mod(..) => ReorderableItemKind::Mod,
236+
ast::ItemKind::Mod(ref m) if m.inner.hi() != item.span.hi() => ReorderableItemKind::Mod,
237237
ast::ItemKind::Use(..) => ReorderableItemKind::Use,
238238
_ => ReorderableItemKind::Other,
239239
}

0 commit comments

Comments
 (0)