cleanup
Error::from is already a function taking 1 parameter, there's no need to wrap it with `|e| Error::from(e)`. Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
8fdef1a81c
commit
fc7f03523c
|
@ -69,7 +69,7 @@ fn run() -> Result<(), Error> {
|
||||||
let acceptor = std::sync::Arc::new(tokio_tls::TlsAcceptor::from(acceptor));
|
let acceptor = std::sync::Arc::new(tokio_tls::TlsAcceptor::from(acceptor));
|
||||||
let connections = listener
|
let connections = listener
|
||||||
.incoming()
|
.incoming()
|
||||||
.map_err(|e| Error::from(e))
|
.map_err(Error::from)
|
||||||
.and_then(move |sock| acceptor.accept(sock).map_err(|e| e.into()))
|
.and_then(move |sock| acceptor.accept(sock).map_err(|e| e.into()))
|
||||||
.then(|r| match r {
|
.then(|r| match r {
|
||||||
// accept()s can fail here with an Err() when eg. the client rejects
|
// accept()s can fail here with an Err() when eg. the client rejects
|
||||||
|
|
|
@ -43,12 +43,12 @@ impl HttpClient {
|
||||||
|
|
||||||
let future = client
|
let future = client
|
||||||
.request(request)
|
.request(request)
|
||||||
.map_err(|e| Error::from(e))
|
.map_err(Error::from)
|
||||||
.and_then(|resp| {
|
.and_then(|resp| {
|
||||||
|
|
||||||
let status = resp.status();
|
let status = resp.status();
|
||||||
|
|
||||||
resp.into_body().concat2().map_err(|e| Error::from(e))
|
resp.into_body().concat2().map_err(Error::from)
|
||||||
.and_then(move |data| {
|
.and_then(move |data| {
|
||||||
|
|
||||||
let text = String::from_utf8(data.to_vec()).unwrap();
|
let text = String::from_utf8(data.to_vec()).unwrap();
|
||||||
|
|
|
@ -179,7 +179,7 @@ fn proxy_protected_request(
|
||||||
|
|
||||||
let resp = hyper::client::Client::new()
|
let resp = hyper::client::Client::new()
|
||||||
.request(request)
|
.request(request)
|
||||||
.map_err(|e| Error::from(e))
|
.map_err(Error::from)
|
||||||
.map(|mut resp| {
|
.map(|mut resp| {
|
||||||
resp.extensions_mut().insert(NoLogExtension());
|
resp.extensions_mut().insert(NoLogExtension());
|
||||||
resp
|
resp
|
||||||
|
|
|
@ -86,7 +86,7 @@ impl Iterator for ReadDir {
|
||||||
fn next(&mut self) -> Option<Self::Item> {
|
fn next(&mut self) -> Option<Self::Item> {
|
||||||
self.iter.next().map(|res| {
|
self.iter.next().map(|res| {
|
||||||
res.map(|entry| ReadDirEntry { entry, parent_fd: self.dir_fd })
|
res.map(|entry| ReadDirEntry { entry, parent_fd: self.dir_fd })
|
||||||
.map_err(|e| Error::from(e))
|
.map_err(Error::from)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue