Replace Zeroizing derive(Debug) with an empty block
I do understand this is opinionated, yet if I want the memory cleared when I'm done with it, I don't want to hear it's still in a log file somewhere. In my opinion, at least by default, Zeroizing should stub Debug with:
use core::fmt::{Debug, Formatter};
impl<Z> Debug for Zeroizing<Z> {
fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), core::fmt::Error> {
fmt.debug_struct("Zeroizing").finish()
}
}
Yeah, that would be OK, although it might be helpful to still display the inner type name via DebugStruct (as sourced via core::any::type_name) + finish_non_exhaustive
Thanks for the tip on type_name. I learned of finish_non_exhaustive after this, yet can make a PR with this later :+1:
I don't think it's an area of responsibility for zeroize. Arguably, you should use the opaque-debug crate or add a manual opaque Debug implementation for your type which gets wrapped by Zeroizing.