MCPcopy Create free account
hub / github.com/RustCrypto/utils / attr_skip

Function attr_skip

zeroize_derive/src/lib.rs:394–414  ·  view source on GitHub ↗
(attrs: &[Attribute])

Source from the content-addressed store, hash-verified

392}
393
394fn attr_skip(attrs: &[Attribute]) -> bool {
395 let mut result = false;
396 for attr in attrs.iter().map(|attr| &attr.meta) {
397 if let Meta::List(list) = attr {
398 if list.path.is_ident(ZEROIZE_ATTR) {
399 for meta in list
400 .parse_args_with(Punctuated::<Meta, Comma>::parse_terminated)
401 .unwrap_or_else(|e| panic!("error parsing attribute: {list:?} ({e})"))
402 {
403 if let Meta::Path(path) = meta {
404 if path.is_ident("skip") {
405 assert!(!result, "duplicate #[zeroize] skip flags");
406 result = true;
407 }
408 }
409 }
410 }
411 }
412 }
413 result
414}
415
416fn impl_zeroize_on_drop(input: &DeriveInput) -> TokenStream {
417 let name = input.ident.clone();

Callers 2

parseMethod · 0.85
generate_fieldsFunction · 0.85

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected