Skip to content

Commit 3141f34

Browse files
secrecy: impl From<&str> for SecretString (#1237)
1 parent 08977b5 commit 3141f34

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

secrecy/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,12 @@ impl From<String> for SecretString {
219219
}
220220
}
221221

222+
impl From<&str> for SecretString {
223+
fn from(s: &str) -> Self {
224+
Self::from(String::from(s))
225+
}
226+
}
227+
222228
impl Clone for SecretString {
223229
fn clone(&self) -> Self {
224230
SecretBox {

0 commit comments

Comments
 (0)