You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Replace Zeroizing derive(Debug) with an empty block #825
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>DebugforZeroizing<Z>{fnfmt(&self,fmt:&mutFormatter<'_>) -> 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
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.
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.
Okay, but if that's the case then Zeroizing shouldn't implement Debug at all then. If I submitted a PR that added this as an optional feature, would it likely be accepted?
Activity
tarcieri commentedon Dec 30, 2022
Yeah, that would be OK, although it might be helpful to still display the inner type name via
DebugStruct(as sourced viacore::any::type_name) +finish_non_exhaustivekayabaNerve commentedon Dec 31, 2022
Thanks for the tip on type_name. I learned of finish_non_exhaustive after this, yet can make a PR with this later 👍
newpavlov commentedon Mar 1, 2024
I don't think it's an area of responsibility for
zeroize. Arguably, you should use theopaque-debugcrate or add a manual opaqueDebugimplementation for your type which gets wrapped byZeroizing.Pandapip1 commentedon Apr 12, 2026
Okay, but if that's the case then Zeroizing shouldn't implement Debug at all then. If I submitted a PR that added this as an optional feature, would it likely be accepted?
tarcieri commentedon Apr 14, 2026
Please don't add additional dependencies to
zeroize, especially for something as trivial asopaque-debugPandapip1 commentedon Apr 16, 2026
From
opaque-debug:I'm not suggesting to add additional dependencies, I'm suggesting that the (optional!) feature be added.
zeroize: replace derived Debug with opaque impl for Zeroizing (#1497)