From 73d16bd71dc7504bd5cac8c21ec45c80a386e7b7 Mon Sep 17 00:00:00 2001 From: bcksl <121328003+bcksl@users.noreply.github.com> Date: Mon, 13 Nov 2023 15:46:14 +0200 Subject: [PATCH] fix(rustler_codegen): warnings for non-snake case atom module names (#573) --- rustler_codegen/src/ex_struct.rs | 1 + rustler_codegen/src/map.rs | 1 + rustler_codegen/src/record.rs | 1 + rustler_codegen/src/tagged_enum.rs | 1 + rustler_codegen/src/unit_enum.rs | 1 + 5 files changed, 5 insertions(+) diff --git a/rustler_codegen/src/ex_struct.rs b/rustler_codegen/src/ex_struct.rs index e051c494..4d720606 100644 --- a/rustler_codegen/src/ex_struct.rs +++ b/rustler_codegen/src/ex_struct.rs @@ -53,6 +53,7 @@ pub fn transcoder_decorator(ast: &syn::DeriveInput, add_exception: bool) -> Toke }; let gen = quote! { + #[allow(non_snake_case)] mod #atoms_module_name { #atom_defs } diff --git a/rustler_codegen/src/map.rs b/rustler_codegen/src/map.rs index 9065d132..5cc9e0d3 100644 --- a/rustler_codegen/src/map.rs +++ b/rustler_codegen/src/map.rs @@ -37,6 +37,7 @@ pub fn transcoder_decorator(ast: &syn::DeriveInput) -> TokenStream { }; let gen = quote! { + #[allow(non_snake_case)] mod #atoms_module_name { #atom_defs } diff --git a/rustler_codegen/src/record.rs b/rustler_codegen/src/record.rs index b568b78f..6d418e87 100644 --- a/rustler_codegen/src/record.rs +++ b/rustler_codegen/src/record.rs @@ -37,6 +37,7 @@ pub fn transcoder_decorator(ast: &syn::DeriveInput) -> TokenStream { }; let gen = quote! { + #[allow(non_snake_case)] mod #atoms_module_name { #atom_defs } diff --git a/rustler_codegen/src/tagged_enum.rs b/rustler_codegen/src/tagged_enum.rs index fe78d331..18678b36 100644 --- a/rustler_codegen/src/tagged_enum.rs +++ b/rustler_codegen/src/tagged_enum.rs @@ -71,6 +71,7 @@ pub fn transcoder_decorator(ast: &syn::DeriveInput) -> TokenStream { }; let gen = quote! { + #[allow(non_snake_case)] mod #atoms_module_name { #atom_defs } diff --git a/rustler_codegen/src/unit_enum.rs b/rustler_codegen/src/unit_enum.rs index 9d443ac7..e0e8ff49 100644 --- a/rustler_codegen/src/unit_enum.rs +++ b/rustler_codegen/src/unit_enum.rs @@ -55,6 +55,7 @@ pub fn transcoder_decorator(ast: &syn::DeriveInput) -> TokenStream { }; let gen = quote! { + #[allow(non_snake_case)] mod #atoms_module_name { #atom_defs }