From 89a7108296dbab81211705eb7a71b2d24204d783 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Wed, 9 Oct 2024 12:55:53 -0600 Subject: [PATCH] secrecy: impl `From<&str>` for `SecretString` --- 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 {