(attrs: &[Attribute])
| 392 | } |
| 393 | |
| 394 | fn 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 | |
| 416 | fn impl_zeroize_on_drop(input: &DeriveInput) -> TokenStream { |
| 417 | let name = input.ident.clone(); |
no test coverage detected