File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,18 @@ use quote::quote;
14
14
use syn:: { Attribute , Meta , NestedMeta } ;
15
15
use synstructure:: { decl_derive, BindStyle } ;
16
16
17
+ decl_derive ! (
18
+ [ Zeroize , attributes( zeroize) ] =>
19
+
20
+ /// Derive the `Zeroize` trait.
21
+ ///
22
+ /// Supports the following attribute:
23
+ ///
24
+ /// - `#[zeroize(drop)]`: derives the `Drop` trait, calling `zeroize()`
25
+ /// when this item is dropped.
26
+ derive_zeroize
27
+ ) ;
28
+
17
29
/// Name of zeroize-related attributes
18
30
const ZEROIZE_ATTR : & str = "zeroize" ;
19
31
@@ -30,8 +42,6 @@ fn derive_zeroize(s: synstructure::Structure<'_>) -> TokenStream {
30
42
}
31
43
}
32
44
33
- decl_derive ! ( [ Zeroize , attributes( zeroize) ] => derive_zeroize) ;
34
-
35
45
/// Custom derive attributes for `Zeroize`
36
46
#[ derive( Default ) ]
37
47
struct ZeroizeAttrs {
You can’t perform that action at this time.
0 commit comments