Skip to content

Commit

Permalink
zeroize: impl Zeroize for core::num::Wrapping
Browse files Browse the repository at this point in the history
Closes #803
  • Loading branch information
tarcieri committed Dec 1, 2022
1 parent f56a234 commit 0154934
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions zeroize/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ use core::{
marker::{PhantomData, PhantomPinned},
mem::{self, MaybeUninit},
num::{
NonZeroI128, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8, NonZeroIsize, NonZeroU128,
NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8, NonZeroUsize,
self, NonZeroI128, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8, NonZeroIsize,
NonZeroU128, NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8, NonZeroUsize,
},
ops, ptr,
slice::IterMut,
Expand Down Expand Up @@ -349,6 +349,15 @@ impl_zeroize_for_non_zero!(
NonZeroUsize
);

impl<Z> Zeroize for num::Wrapping<Z>
where
Z: Zeroize,
{
fn zeroize(&mut self) {
self.0.zeroize();
}
}

/// Impl [`Zeroize`] on arrays of types that impl [`Zeroize`].
impl<Z, const N: usize> Zeroize for [Z; N]
where
Expand Down

0 comments on commit 0154934

Please sign in to comment.