From a3956ac420705dde5c3c4176e84ff61fb50149a7 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Sat, 25 May 2024 11:53:46 -0600 Subject: [PATCH] zeroize: fix unnecessary qualifications --- zeroize/derive/src/lib.rs | 6 +++--- zeroize/tests/zeroize_derive.rs | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/zeroize/derive/src/lib.rs b/zeroize/derive/src/lib.rs index 2f31fc65..9bbc1ca8 100644 --- a/zeroize/derive/src/lib.rs +++ b/zeroize/derive/src/lib.rs @@ -176,7 +176,7 @@ impl ZeroizeAttrs { } match &input.data { - syn::Data::Enum(enum_) => { + Data::Enum(enum_) => { for variant in &enum_.variants { for attr in &variant.attrs { result.parse_attr(attr, Some(variant), None); @@ -191,7 +191,7 @@ impl ZeroizeAttrs { } } } - syn::Data::Struct(struct_) => { + Data::Struct(struct_) => { for field in &struct_.fields { for attr in &field.attrs { result.parse_attr(attr, None, Some(field)); @@ -201,7 +201,7 @@ impl ZeroizeAttrs { } } } - syn::Data::Union(union_) => panic!("Unsupported untagged union {:?}", union_), + Data::Union(union_) => panic!("Unsupported untagged union {:?}", union_), } result.auto_params = bound_accumulator.params; diff --git a/zeroize/tests/zeroize_derive.rs b/zeroize/tests/zeroize_derive.rs index e7939bf0..1ab83e2e 100644 --- a/zeroize/tests/zeroize_derive.rs +++ b/zeroize/tests/zeroize_derive.rs @@ -1,4 +1,5 @@ //! Integration tests for `zeroize_derive` proc macros + #![cfg(feature = "zeroize_derive")] use zeroize::{Zeroize, ZeroizeOnDrop}; @@ -318,6 +319,7 @@ fn derive_deref() { #[test] #[cfg(feature = "alloc")] +#[allow(dead_code)] fn derive_zeroize_on_drop_generic() { #[derive(ZeroizeOnDrop)] struct Y(Box); @@ -327,6 +329,7 @@ fn derive_zeroize_on_drop_generic() { } #[test] +#[allow(dead_code)] fn derive_zeroize_unused_param() { #[derive(Zeroize)] struct Z { @@ -337,6 +340,7 @@ fn derive_zeroize_unused_param() { } #[test] +#[allow(dead_code)] // Issue #878 fn derive_zeroize_with_marker() { #[derive(ZeroizeOnDrop, Zeroize)] @@ -354,6 +358,7 @@ fn derive_zeroize_with_marker() { } #[test] +#[allow(dead_code)] // Issue #878 fn derive_zeroize_used_param() { #[derive(Zeroize)]