From 3141f34be507f543a1a2f87ebc177a401024785e Mon Sep 17 00:00:00 2001 From: "Tony Arcieri (iqlusion)" Date: Wed, 9 Oct 2024 13:03:43 -0600 Subject: [PATCH] secrecy: impl `From<&str>` for `SecretString` (#1237) --- secrecy/src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/secrecy/src/lib.rs b/secrecy/src/lib.rs index 2b81477e..ecbe2297 100644 --- a/secrecy/src/lib.rs +++ b/secrecy/src/lib.rs @@ -219,6 +219,12 @@ impl From for SecretString { } } +impl From<&str> for SecretString { + fn from(s: &str) -> Self { + Self::from(String::from(s)) + } +} + impl Clone for SecretString { fn clone(&self) -> Self { SecretBox {