Skip to content

Commit

Permalink
Replace a match with some as_ref and as
Browse files Browse the repository at this point in the history
The match was doing a deref coercion.

Found by current nightly's needless_match (whose suggestion doesn't
compile, rust-lang/rust-clippy#8551 )
  • Loading branch information
ijackson committed Mar 16, 2022
1 parent 9593cf6 commit 7564fab
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions crates/tor-netdoc/src/err.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,10 +431,7 @@ impl fmt::Display for Error {

impl std::error::Error for Error {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match &self.source {
Some(e) => Some(e),
None => None,
}
self.source.as_ref().map(|s| s as _)
}
}

Expand Down

0 comments on commit 7564fab

Please sign in to comment.