From 58cbf700e11dd69381fc702a96474b134a081fab Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Tue, 1 Oct 2024 12:26:48 -0600 Subject: [PATCH] secrecy: impl `Default` for `SecretString` Closes #1228 --- secrecy/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/secrecy/src/lib.rs b/secrecy/src/lib.rs index 13adcff7..dc1d18a8 100644 --- a/secrecy/src/lib.rs +++ b/secrecy/src/lib.rs @@ -205,6 +205,12 @@ impl Clone for SecretString { } } +impl Default for SecretString { + fn default() -> SecretString { + String::default().into() + } +} + /// Marker trait for secrets which are allowed to be cloned pub trait CloneableSecret: Clone + Zeroize {}