File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1
- //! Tidy check to ensure that crate `edition` is '2018 ' or '2021 '.
1
+ //! Tidy check to ensure that crate `edition` is '2021 ' or '2024 '.
2
2
3
3
use std:: path:: Path ;
4
4
@@ -12,18 +12,20 @@ pub fn check(path: &Path, bad: &mut bool) {
12
12
return ;
13
13
}
14
14
15
- let is_2021 = contents. lines ( ) . any ( |line| line. trim ( ) == "edition = \" 2021\" " ) ;
15
+ let is_current_edition = contents
16
+ . lines ( )
17
+ . any ( |line| line. trim ( ) == "edition = \" 2021\" " || line. trim ( ) == "edition = \" 2024\" " ) ;
16
18
17
19
let is_workspace = contents. lines ( ) . any ( |line| line. trim ( ) == "[workspace]" ) ;
18
20
let is_package = contents. lines ( ) . any ( |line| line. trim ( ) == "[package]" ) ;
19
21
assert ! ( is_workspace || is_package) ;
20
22
21
23
// Check that all packages use the 2021 edition. Virtual workspaces don't allow setting an
22
24
// edition, so these shouldn't be checked.
23
- if is_package && !is_2021 {
25
+ if is_package && !is_current_edition {
24
26
tidy_error ! (
25
27
bad,
26
- "{} doesn't have `edition = \" 2021\" ` on a separate line" ,
28
+ "{} doesn't have `edition = \" 2021\" ` or `edition = \" 2024 \" ` on a separate line" ,
27
29
file. display( )
28
30
) ;
29
31
}
You can’t perform that action at this time.
0 commit comments