From 9fe4dcb85ff10500b34d5cb834cf0ed8e144c04f Mon Sep 17 00:00:00 2001 From: rascul Date: Sat, 16 Mar 2024 02:40:05 -0500 Subject: [PATCH] add from &'str --- src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index ccca25b..485bcff 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -63,6 +63,12 @@ impl From for Rear { } } +impl From<&str> for Rear { + fn from(error: &str) -> Self { + Self { message: error.to_string(), error: error.into() } + } +} + #[cfg(feature = "askama")] impl From for Rear { fn from(error: askama::Error) -> Self {