Create 2024 edition

This commit is contained in:
Jacob Pratt 2022-02-28 18:13:24 -05:00
parent 8211d64c71
commit 6c6ebec516
2 changed files with 6 additions and 0 deletions

View File

@ -693,6 +693,7 @@ fn edition_from_edition_str(edition_str: &str) -> Result<Edition> {
"2015" => Ok(Edition::Edition2015), "2015" => Ok(Edition::Edition2015),
"2018" => Ok(Edition::Edition2018), "2018" => Ok(Edition::Edition2018),
"2021" => Ok(Edition::Edition2021), "2021" => Ok(Edition::Edition2021),
"2024" => Ok(Edition::Edition2024),
_ => Err(format_err!("Invalid value for `--edition`")), _ => Err(format_err!("Invalid value for `--edition`")),
} }
} }

View File

@ -423,6 +423,10 @@ pub enum Edition {
#[doc_hint = "2021"] #[doc_hint = "2021"]
/// Edition 2021. /// Edition 2021.
Edition2021, Edition2021,
#[value = "2024"]
#[doc_hint = "2024"]
/// Edition 2024.
Edition2024,
} }
impl Default for Edition { impl Default for Edition {
@ -437,6 +441,7 @@ fn from(edition: Edition) -> Self {
Edition::Edition2015 => Self::Edition2015, Edition::Edition2015 => Self::Edition2015,
Edition::Edition2018 => Self::Edition2018, Edition::Edition2018 => Self::Edition2018,
Edition::Edition2021 => Self::Edition2021, Edition::Edition2021 => Self::Edition2021,
Edition::Edition2024 => Self::Edition2024,
} }
} }
} }