diff --git a/generate-api/src/generator.rs b/generate-api/src/generator.rs index c359fba..0540b29 100644 --- a/generate-api/src/generator.rs +++ b/generate-api/src/generator.rs @@ -477,6 +477,18 @@ impl CodeGenerator { self.generate_variants(f)?; + write!( + f, + r#" + + #[allow(clippy::derivable_impls)] // manual impl for rust 1.61 compatibility + impl Default for Locale {{ + fn default() -> Self {{ + Locale::POSIX + }} + }} + "#, + )?; Ok(()) } @@ -495,7 +507,7 @@ impl CodeGenerator { /// License note: The Free Software Foundation does not claim any copyright interest in the locale /// data of the GNU C Library; they believe it is not copyrightable. #[allow(non_camel_case_types,dead_code)] - #[derive(Copy, Clone, Default, PartialEq, Eq, Hash)] + #[derive(Copy, Clone, PartialEq, Eq, Hash)] pub enum Locale {{ "#, )?; @@ -523,9 +535,6 @@ impl CodeGenerator { _ => "".to_string(), }; write!(f, "\n/// `{}`: {}\n", lang, desc)?; - if lang == "POSIX" { - writeln!(f, "\n#[default]\n")?; - } writeln!(f, "\n{},\n", norm)?; } diff --git a/src/lib.rs b/src/lib.rs index 56bfb57..c4ef54e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -55115,10 +55115,9 @@ pub mod zu_ZA { /// License note: The Free Software Foundation does not claim any copyright interest in the locale /// data of the GNU C Library; they believe it is not copyrightable. #[allow(non_camel_case_types,dead_code)] -#[derive(Copy, Clone, Default, PartialEq, Eq, Hash)] +#[derive(Copy, Clone, PartialEq, Eq, Hash)] pub enum Locale { /// `POSIX`: POSIX Standard Locale. - #[default] POSIX, /// `aa_DJ`: Afar language locale for Djibouti (Cadu/Laaqo Dialects). aa_DJ, @@ -56838,3 +56837,10 @@ macro_rules! locale_match { } }} } + +#[allow(clippy::derivable_impls)] // manual impl for rust 1.61 compatibility +impl Default for Locale { + fn default() -> Self { + Locale::POSIX + } +}