From 4877b2d5e4ec49971d3519dcb9542dad60391dcb Mon Sep 17 00:00:00 2001 From: "Tony Arcieri (iqlusion)" Date: Wed, 18 Sep 2024 06:59:28 -0600 Subject: [PATCH] secrecy: impl `Clone` for `SecretString` (#1217) Fixes a regression from previous releases --- secrecy/src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/secrecy/src/lib.rs b/secrecy/src/lib.rs index 48570aeb..184e45c7 100644 --- a/secrecy/src/lib.rs +++ b/secrecy/src/lib.rs @@ -197,6 +197,14 @@ impl From for SecretString { } } +impl Clone for SecretString { + fn clone(&self) -> Self { + SecretBox { + inner_secret: self.inner_secret.clone(), + } + } +} + /// Marker trait for secrets which are allowed to be cloned pub trait CloneableSecret: Clone + Zeroize {}