Skip to content

Commit 115c32e

Browse files
JDSeilerdginev
authored andcommitted
Incorporate review suggestion for message function
1 parent ffe84ff commit 115c32e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl StructuredError {
101101
/// StructuredError `message` field directly.
102102
#[deprecated(since="0.3.3", note="Please use the `message` field directly instead.")]
103103
pub fn message(&self) -> &str {
104-
self.message.as_ref().unwrap().as_str()
104+
self.message.as_deref().unwrap_or("")
105105
}
106106

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

0 commit comments

Comments
 (0)