Fix clippy lints (#387)
This commit is contained in:
@@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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)));
|
||||
}
|
||||
|
||||
let proto = if let Some(ref proxy) = proxy {
|
||||
Some(proxy.proto)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let proto = proxy.as_ref().map(|proxy| proxy.proto);
|
||||
|
||||
let mut any_err = None;
|
||||
let mut any_stream = None;
|
||||
|
||||
Reference in New Issue
Block a user