Skip to content

Commit

Permalink
Incorporate review suggestion for message function
Browse files Browse the repository at this point in the history
  • Loading branch information
JDSeiler authored and dginev committed Jul 18, 2023
1 parent ffe84ff commit 115c32e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ impl StructuredError {
/// StructuredError `message` field directly.
#[deprecated(since="0.3.3", note="Please use the `message` field directly instead.")]
pub fn message(&self) -> &str {
self.message.as_ref().unwrap().as_str()
self.message.as_deref().unwrap_or("")
}

/// Returns the provided c_str as Some(String), or None if the provided pointer is null.
Expand Down

0 comments on commit 115c32e

Please sign in to comment.