From 989995d1ba20713a6937ae04ca0a9bccb79c94ef Mon Sep 17 00:00:00 2001 From: Martin Algesten Date: Wed, 12 May 2021 03:05:17 +0200 Subject: [PATCH] Fix clippy lints (#387) --- src/error.rs | 7 +++---- src/stream.rs | 6 +----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/error.rs b/src/error.rs index 7165a64..939e4c6 100644 --- a/src/error.rs +++ b/src/error.rs @@ -180,10 +180,9 @@ impl error::Error for Error { impl error::Error for Transport { fn source(&self) -> Option<&(dyn error::Error + 'static)> { - match &self.source { - Some(s) => Some(s.as_ref()), - None => None, - } + self.source + .as_ref() + .map(|s| s.as_ref() as &(dyn error::Error + 'static)) } } diff --git a/src/stream.rs b/src/stream.rs index 7773fba..fd4b5bd 100644 --- a/src/stream.rs +++ b/src/stream.rs @@ -397,11 +397,7 @@ pub(crate) fn connect_host(unit: &Unit, hostname: &str, port: u16) -> Result