Skip to content

Commit 5092eec

Browse files
committed
Merge pull request rust-lang#966 from MicahChalmer/skip-children-in-plain-write-mode
Always skip children when using Plain write mode
2 parents de2b8d9 + 70611bf commit 5092eec

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,11 @@ fn format_ast(krate: &ast::Crate,
280280
config: &Config)
281281
-> FileMap {
282282
let mut file_map = FileMap::new();
283+
// We always skip children for the "Plain" write mode, since there is
284+
// nothing to distinguish the nested module contents.
285+
let skip_children = config.skip_children || config.write_mode == config::WriteMode::Plain;
283286
for (path, module) in modules::list_files(krate, parse_session.codemap()) {
284-
if config.skip_children && path.as_path() != main_file {
287+
if skip_children && path.as_path() != main_file {
285288
continue;
286289
}
287290
let path = path.to_str().unwrap();

0 commit comments

Comments
 (0)