Skip to content

Commit

Permalink
Oh turns out we can return &str after all.
Browse files Browse the repository at this point in the history
  • Loading branch information
JDSeiler authored and dginev committed Jul 18, 2023
1 parent 31d0819 commit ffe84ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit ffe84ff

Please sign in to comment.