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.