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

Function derive_enum_test

zeroize/tests/zeroize_derive.rs:49–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

47
48#[test]
49fn derive_enum_test() {
50 #[derive(Zeroize, ZeroizeOnDrop)]
51 enum Z {
52 #[allow(dead_code)]
53 Variant1,
54 Variant2(usize),
55 }
56
57 let mut value = Z::Variant2(26);
58
59 value.zeroize();
60
61 assert!(matches!(value, Z::Variant2(0)));
62}
63
64/// Test that the custom macro actually derived `Drop` for `Z`
65#[test]

Callers

nothing calls this directly

Calls 1

zeroizeMethod · 0.45

Tested by

no test coverage detected