Skip to content

Commit

Permalink
Stop duplication in error source chain
Browse files Browse the repository at this point in the history
Don't both print the contained error in the Display impl and also return
it in source
  • Loading branch information
faern committed Oct 30, 2024
1 parent 6dd4dc8 commit b2055bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mullvad-encrypted-dns-proxy/src/config_resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ impl fmt::Display for Error {
impl std::error::Error for Error {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
match self {
Self::ResolutionError(ref err) => Some(err),
Self::Timeout(ref err) => Some(err),
Self::ResolutionError(ref err) => err.source(),
Self::Timeout(ref err) => err.source(),
}
}
}
Expand Down

0 comments on commit b2055bf

Please sign in to comment.