Skip to content

Commit 4877b2d

Browse files
secrecy: impl Clone for SecretString (#1217)
Fixes a regression from previous releases
1 parent 4c7f459 commit 4877b2d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

secrecy/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,14 @@ impl From<String> for SecretString {
197197
}
198198
}
199199

200+
impl Clone for SecretString {
201+
fn clone(&self) -> Self {
202+
SecretBox {
203+
inner_secret: self.inner_secret.clone(),
204+
}
205+
}
206+
}
207+
200208
/// Marker trait for secrets which are allowed to be cloned
201209
pub trait CloneableSecret: Clone + Zeroize {}
202210

0 commit comments

Comments
 (0)