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;
1414use syn:: { Attribute , Meta , NestedMeta } ;
1515use synstructure:: { decl_derive, BindStyle } ;
1616
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+
1729/// Name of zeroize-related attributes
1830const ZEROIZE_ATTR : & str = "zeroize" ;
1931
@@ -30,8 +42,6 @@ fn derive_zeroize(s: synstructure::Structure<'_>) -> TokenStream {
3042 }
3143}
3244
33- decl_derive ! ( [ Zeroize , attributes( zeroize) ] => derive_zeroize) ;
34-
3545/// Custom derive attributes for `Zeroize`
3646#[ derive( Default ) ]
3747struct ZeroizeAttrs {
You can’t perform that action at this time.
0 commit comments