Fix clippy lints (#387)

This commit is contained in:
Martin Algesten authored and GitHub committed 2021-05-11 18:05:17 -07:00
1 parent c06c345f28
commit 989995d1ba
2 files changed
+4 -9

No files matched your search

+3 -4
View File
@@ -180,10 +180,9 @@ impl error::Error for Error {
impl error::Error for Transport { impl error::Error for Transport {
fn source(&self) -> Option<&(dyn error::Error + 'static)> { fn source(&self) -> Option<&(dyn error::Error + 'static)> {
match &self.source { self.source
Some(s) => Some(s.as_ref()), .as_ref()
None => None, .map(|s| s.as_ref() as &(dyn error::Error + 'static))
}
} }
} }
+1 -5
View File
@@ -397,11 +397,7 @@ pub(crate) fn connect_host(unit: &Unit, hostname: &str, port: u16) -> Result<Tcp
return Err(ErrorKind::Dns.msg(&format!("No ip address for {}", hostname))); return Err(ErrorKind::Dns.msg(&format!("No ip address for {}", hostname)));
} }
let proto = if let Some(ref proxy) = proxy { let proto = proxy.as_ref().map(|proxy| proxy.proto);
Some(proxy.proto)
} else {
None
};
let mut any_err = None; let mut any_err = None;
let mut any_stream = None; let mut any_stream = None;