Skip to content

Commit 0bd77f2

Browse files
committed
Do not reorder inline modules
1 parent cea5a92 commit 0bd77f2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/reorder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use attr::filter_inline_attrs;
2323
use codemap::LineRangeUtils;
2424
use comment::combine_strs_with_missing_comments;
2525
use imports::{path_to_imported_ident, rewrite_import};
26-
use items::{rewrite_extern_crate, rewrite_mod};
26+
use items::{is_mod_decl, rewrite_extern_crate, rewrite_mod};
2727
use lists::{itemize_list, write_list, ListFormatting};
2828
use rewrite::{Rewrite, RewriteContext};
2929
use shape::Shape;
@@ -234,7 +234,7 @@ impl ReorderableItemKind {
234234
match item.node {
235235
_ if contains_macro_use_attr(item) => ReorderableItemKind::Other,
236236
ast::ItemKind::ExternCrate(..) => ReorderableItemKind::ExternCrate,
237-
ast::ItemKind::Mod(..) => ReorderableItemKind::Mod,
237+
ast::ItemKind::Mod(..) if is_mod_decl(item) => ReorderableItemKind::Mod,
238238
ast::ItemKind::Use(..) => ReorderableItemKind::Use,
239239
_ => ReorderableItemKind::Other,
240240
}

0 commit comments

Comments
 (0)