Skip to content

Commit adb6b8d

Browse files
committed
zeroize: replace derived Debug with opaque impl for Zeroizing
1 parent 4901253 commit adb6b8d

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

zeroize/src/lib.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,10 +599,16 @@ impl Zeroize for CString {
599599
///
600600
/// `Zeroizing<T>` is defined with `repr(transparent)`, which means it is
601601
/// guaranteed to have the same physical representation as the underlying type.
602-
#[derive(Debug, Default, Eq, PartialEq)]
602+
#[derive(Default, Eq, PartialEq)]
603603
#[repr(transparent)]
604604
pub struct Zeroizing<Z: Zeroize + ?Sized>(Z);
605605

606+
impl<Z: Zeroize + ?Sized> core::fmt::Debug for Zeroizing<Z> {
607+
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
608+
f.debug_struct("Zeroizing").finish_non_exhaustive()
609+
}
610+
}
611+
606612
impl<Z> Zeroizing<Z>
607613
where
608614
Z: Zeroize,

0 commit comments

Comments
 (0)