1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-29 00:07:48 +02:00

Handler::handle uses &self instead of mutabble reference

This commit is contained in:
Nikolay Kim
2018-06-21 17:07:54 +06:00
parent 5a9992736f
commit 3de9284592
12 changed files with 57 additions and 50 deletions

View File

@@ -282,9 +282,9 @@ impl<S: 'static> ResourceHandler<S> {
}
pub(crate) fn handle(
&mut self, mut req: HttpRequest<S>,
&self, mut req: HttpRequest<S>,
) -> Result<AsyncResult<HttpResponse>, HttpRequest<S>> {
for route in &mut self.routes {
for route in &self.routes {
if route.check(&mut req) {
return if self.middlewares.borrow().is_empty() {
Ok(route.handle(req))