Skip to content

Commit

Permalink
show source error unless unavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
r58Playz committed Jul 28, 2024
1 parent 527bf20 commit 8b63c02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/client/legacy/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1541,7 +1541,7 @@ impl fmt::Debug for Error {

impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "client error ({})", self.source.unwrap_or_else(|| format!("{:?}", self.kind)));
write!(f, "client error ({})", self.source.as_ref().map(|x| format!("{}", x)).unwrap_or_else(|| format!("{:?}", self.kind)))
}
}

Expand Down

0 comments on commit 8b63c02

Please sign in to comment.