Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/parser/src/edition.rs')
| -rw-r--r-- | crates/parser/src/edition.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/parser/src/edition.rs b/crates/parser/src/edition.rs index 26178544f9..5872368860 100644 --- a/crates/parser/src/edition.rs +++ b/crates/parser/src/edition.rs @@ -12,8 +12,13 @@ pub enum Edition { } impl Edition { + /// The current latest stable edition, note this is usually not the right choice in code. pub const CURRENT: Edition = Edition::Edition2021; pub const DEFAULT: Edition = Edition::Edition2015; + + pub fn at_least_2024(self) -> bool { + self >= Edition::Edition2024 + } } #[derive(Debug)] |