From ffe84ffe2229f0d34cfb3419f7593c4b17dabd0d Mon Sep 17 00:00:00 2001 From: JDSeiler Date: Mon, 17 Jul 2023 20:05:02 -0400 Subject: [PATCH] Oh turns out we can return &str after all. --- src/error.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/error.rs b/src/error.rs index 896c0d587..4b66f13c0 100644 --- a/src/error.rs +++ b/src/error.rs @@ -100,8 +100,8 @@ impl StructuredError { /// reporting mechanism. Instead of calling this method, you can access the /// StructuredError `message` field directly. #[deprecated(since="0.3.3", note="Please use the `message` field directly instead.")] - pub fn message(&self) -> &String { - self.message.as_ref().unwrap() + pub fn message(&self) -> &str { + self.message.as_ref().unwrap().as_str() } /// Returns the provided c_str as Some(String), or None if the provided pointer is null.