1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-22 21:55:10 +02:00

make Task private

This commit is contained in:
Nikolay Kim
2017-11-30 15:13:56 -08:00
parent 271a292ea5
commit 07cc017320
7 changed files with 61 additions and 83 deletions

View File

@@ -4,7 +4,6 @@ use std::collections::HashMap;
use http::Method;
use futures::Future;
use task::Task;
use error::Error;
use route::{Reply, RouteHandler, WrapHandler, Handler, StreamHandler};
use httprequest::HttpRequest;
@@ -112,11 +111,11 @@ impl<S> Resource<S> where S: 'static {
impl<S: 'static> RouteHandler<S> for Resource<S> {
fn handle(&self, req: HttpRequest<S>, task: &mut Task) {
fn handle(&self, req: HttpRequest<S>) -> Reply {
if let Some(handler) = self.routes.get(req.method()) {
handler.handle(req, task)
handler.handle(req)
} else {
self.default.handle(req, task)
self.default.handle(req)
}
}
}