We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 94274a2 + cfe5107 commit 2750e74Copy full SHA for 2750e74
zeroize/src/lib.rs
@@ -295,7 +295,19 @@ where
295
}
296
297
298
-/// Implement `Zeroize` on slices of types that can be zeroized with `Default`.
+impl<Z> Zeroize for Option<Z>
299
+where
300
+ Z: Zeroize,
301
+{
302
+ fn zeroize(&mut self) {
303
+ match self {
304
+ Some(value) => value.zeroize(),
305
+ None => (),
306
+ }
307
308
+}
309
+
310
+/// Impl `Zeroize` on slices of types that can be zeroized with `Default`.
311
///
312
/// This impl can eventually be optimized using an memset intrinsic,
313
/// such as `core::intrinsics::volatile_set_memory`. For that reason the blanket
0 commit comments