Skip to content

Commit a7eddc6

Browse files
authored
zeroize: fix unnecessary qualifications (#1072)
1 parent 9bbfb49 commit a7eddc6

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

zeroize/derive/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ impl ZeroizeAttrs {
176176
}
177177

178178
match &input.data {
179-
syn::Data::Enum(enum_) => {
179+
Data::Enum(enum_) => {
180180
for variant in &enum_.variants {
181181
for attr in &variant.attrs {
182182
result.parse_attr(attr, Some(variant), None);
@@ -191,7 +191,7 @@ impl ZeroizeAttrs {
191191
}
192192
}
193193
}
194-
syn::Data::Struct(struct_) => {
194+
Data::Struct(struct_) => {
195195
for field in &struct_.fields {
196196
for attr in &field.attrs {
197197
result.parse_attr(attr, None, Some(field));
@@ -201,7 +201,7 @@ impl ZeroizeAttrs {
201201
}
202202
}
203203
}
204-
syn::Data::Union(union_) => panic!("Unsupported untagged union {:?}", union_),
204+
Data::Union(union_) => panic!("Unsupported untagged union {:?}", union_),
205205
}
206206

207207
result.auto_params = bound_accumulator.params;

zeroize/tests/zeroize_derive.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//! Integration tests for `zeroize_derive` proc macros
2+
23
#![cfg(feature = "zeroize_derive")]
34

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

319320
#[test]
320321
#[cfg(feature = "alloc")]
322+
#[allow(dead_code)]
321323
fn derive_zeroize_on_drop_generic() {
322324
#[derive(ZeroizeOnDrop)]
323325
struct Y<T: Zeroize>(Box<T>);
@@ -327,6 +329,7 @@ fn derive_zeroize_on_drop_generic() {
327329
}
328330

329331
#[test]
332+
#[allow(dead_code)]
330333
fn derive_zeroize_unused_param() {
331334
#[derive(Zeroize)]
332335
struct Z<T> {
@@ -337,6 +340,7 @@ fn derive_zeroize_unused_param() {
337340
}
338341

339342
#[test]
343+
#[allow(dead_code)]
340344
// Issue #878
341345
fn derive_zeroize_with_marker() {
342346
#[derive(ZeroizeOnDrop, Zeroize)]
@@ -354,6 +358,7 @@ fn derive_zeroize_with_marker() {
354358
}
355359

356360
#[test]
361+
#[allow(dead_code)]
357362
// Issue #878
358363
fn derive_zeroize_used_param() {
359364
#[derive(Zeroize)]

0 commit comments

Comments
 (0)