()
| 443 | |
| 444 | #[test] |
| 445 | fn zeroize_without_drop() { |
| 446 | test_derive( |
| 447 | derive_zeroize_impl, |
| 448 | quote! { |
| 449 | struct Z { |
| 450 | a: String, |
| 451 | b: Vec<u8>, |
| 452 | c: [u8; 3], |
| 453 | } |
| 454 | }, |
| 455 | quote! { |
| 456 | impl ::zeroize::Zeroize for Z { |
| 457 | fn zeroize(&mut self) { |
| 458 | match self { |
| 459 | #[allow(unused_variables, unused_assignments)] |
| 460 | Z { a, b, c } => { |
| 461 | a.zeroize(); |
| 462 | b.zeroize(); |
| 463 | c.zeroize() |
| 464 | } |
| 465 | _ => {} |
| 466 | } |
| 467 | } |
| 468 | } |
| 469 | }, |
| 470 | ); |
| 471 | } |
| 472 | |
| 473 | #[test] |
| 474 | fn zeroize_with_drop() { |
nothing calls this directly
no test coverage detected