Skip to content

Commit

Permalink
secrecy: impl Clone for SecretString
Browse files Browse the repository at this point in the history
Fixes a regression from previous releases
  • Loading branch information
tony-iqlusion committed Sep 18, 2024
1 parent 4c7f459 commit ff40d6b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions secrecy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,14 @@ impl From<String> 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 {}

Expand Down

0 comments on commit ff40d6b

Please sign in to comment.