1 //! Tidy check to ensure that crate `edition` is '2018' or '2021'.
5 fn is_edition_2021(mut line: &str) -> bool {
7 line == "edition = \"2021\""
10 pub fn check(path: &Path, bad: &mut bool) {
13 &mut |path| super::filter_dirs(path) || path.ends_with("src/test"),
14 &mut |entry, contents| {
15 let file = entry.path();
16 let filename = file.file_name().unwrap();
17 if filename != "Cargo.toml" {
21 let is_2021 = contents.lines().any(is_edition_2021);
25 "{} doesn't have `edition = \"2021\"` on a separate line",