Fix clippy lints (#387)
This commit is contained in:
@@ -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))
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user