File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 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 '.
22
33use std:: path:: Path ;
44
@@ -12,18 +12,20 @@ pub fn check(path: &Path, bad: &mut bool) {
1212 return ;
1313 }
1414
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\" " ) ;
1618
1719 let is_workspace = contents. lines ( ) . any ( |line| line. trim ( ) == "[workspace]" ) ;
1820 let is_package = contents. lines ( ) . any ( |line| line. trim ( ) == "[package]" ) ;
1921 assert ! ( is_workspace || is_package) ;
2022
2123 // Check that all packages use the 2021 edition. Virtual workspaces don't allow setting an
2224 // edition, so these shouldn't be checked.
23- if is_package && !is_2021 {
25+ if is_package && !is_current_edition {
2426 tidy_error ! (
2527 bad,
26- "{} doesn't have `edition = \" 2021\" ` on a separate line" ,
28+ "{} doesn't have `edition = \" 2021\" ` or `edition = \" 2024 \" ` on a separate line" ,
2729 file. display( )
2830 ) ;
2931 }
You can’t perform that action at this time.
0 commit comments