Make lint modules private

This commit is contained in:
flip1995
2020-04-02 22:08:10 +02:00
parent a186d9fafd
commit d89bb50f72

View File

@@ -105,7 +105,7 @@ pub fn gen_modules_list<'a>(lints: impl Iterator<Item = &'a Lint>) -> Vec<String
lints lints
.map(|l| &l.module) .map(|l| &l.module)
.unique() .unique()
.map(|module| format!("pub mod {};", module)) .map(|module| format!("mod {};", module))
.sorted() .sorted()
.collect::<Vec<String>>() .collect::<Vec<String>>()
} }
@@ -503,10 +503,7 @@ fn test_gen_modules_list() {
Lint::new("should_assert_eq", "group1", "abc", None, "module_name"), Lint::new("should_assert_eq", "group1", "abc", None, "module_name"),
Lint::new("incorrect_stuff", "group3", "abc", None, "another_module"), Lint::new("incorrect_stuff", "group3", "abc", None, "another_module"),
]; ];
let expected = vec![ let expected = vec!["mod another_module;".to_string(), "mod module_name;".to_string()];
"pub mod another_module;".to_string(),
"pub mod module_name;".to_string(),
];
assert_eq!(expected, gen_modules_list(lints.iter())); assert_eq!(expected, gen_modules_list(lints.iter()));
} }