1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-28 09:42:40 +01:00

clippy warnings

This commit is contained in:
Nikolay Kim 2018-03-16 12:12:55 -07:00
parent 84bf282c17
commit d2693d58a8

View File

@ -445,7 +445,7 @@ impl<S: 'static> Handler<S> for StaticFiles<S> {
fn handle(&mut self, req: HttpRequest<S>) -> Self::Result { fn handle(&mut self, req: HttpRequest<S>) -> Self::Result {
if !self.accessible { if !self.accessible {
return Ok(self.default.handle(req)) Ok(self.default.handle(req))
} else { } else {
let relpath = match req.match_info().get("tail").map(PathBuf::from_param) { let relpath = match req.match_info().get("tail").map(PathBuf::from_param) {
Some(Ok(path)) => path, Some(Ok(path)) => path,
@ -466,21 +466,20 @@ impl<S: 'static> Handler<S> for StaticFiles<S> {
} }
new_path.push_str(redir_index); new_path.push_str(redir_index);
HttpFound.build() HttpFound.build()
.header(header::http::LOCATION, new_path.as_str()) .header(header::http::LOCATION, new_path.as_str())
.finish().unwrap() .finish().unwrap()
.respond_to(req.without_state()) .respond_to(req.without_state())
} else if self.show_index { } else if self.show_index {
Directory::new(self.directory.clone(), path).respond_to(req.without_state()) Directory::new(self.directory.clone(), path)
.map_err(|error| Error::from(error))? .respond_to(req.without_state())?
.respond_to(req.without_state()) .respond_to(req.without_state())
} else { } else {
Ok(self.default.handle(req)) Ok(self.default.handle(req))
} }
} else { } else {
NamedFile::open(path)?.set_cpu_pool(self.cpu_pool.clone()) NamedFile::open(path)?.set_cpu_pool(self.cpu_pool.clone())
.respond_to(req.without_state()) .respond_to(req.without_state())?
.map_err(|error| Error::from(error))? .respond_to(req.without_state())
.respond_to(req.without_state())
} }
} }
} }