Skip to content

Commit

Permalink
zeroize: fix unnecessary qualifications (#1072)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarcieri authored May 25, 2024
1 parent 9bbfb49 commit a7eddc6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions zeroize/derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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));
Expand All @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions zeroize/tests/zeroize_derive.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! Integration tests for `zeroize_derive` proc macros

#![cfg(feature = "zeroize_derive")]

use zeroize::{Zeroize, ZeroizeOnDrop};
Expand Down Expand Up @@ -318,6 +319,7 @@ fn derive_deref() {

#[test]
#[cfg(feature = "alloc")]
#[allow(dead_code)]
fn derive_zeroize_on_drop_generic() {
#[derive(ZeroizeOnDrop)]
struct Y<T: Zeroize>(Box<T>);
Expand All @@ -327,6 +329,7 @@ fn derive_zeroize_on_drop_generic() {
}

#[test]
#[allow(dead_code)]
fn derive_zeroize_unused_param() {
#[derive(Zeroize)]
struct Z<T> {
Expand All @@ -337,6 +340,7 @@ fn derive_zeroize_unused_param() {
}

#[test]
#[allow(dead_code)]
// Issue #878
fn derive_zeroize_with_marker() {
#[derive(ZeroizeOnDrop, Zeroize)]
Expand All @@ -354,6 +358,7 @@ fn derive_zeroize_with_marker() {
}

#[test]
#[allow(dead_code)]
// Issue #878
fn derive_zeroize_used_param() {
#[derive(Zeroize)]
Expand Down

0 comments on commit a7eddc6

Please sign in to comment.