1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-09-02 17:46:38 +02:00

refactor payload

This commit is contained in:
Nikolay Kim
2017-10-08 20:16:48 -07:00
parent e398694bdb
commit e2dc775e21
12 changed files with 257 additions and 153 deletions

View File

@@ -5,9 +5,10 @@ use std::collections::HashMap;
use route_recognizer::Router;
use task::Task;
use route::{Payload, RouteHandler};
use route::RouteHandler;
use router::Handler;
use resource::Resource;
use payload::Payload;
use httpmessage::HttpRequest;
@@ -93,7 +94,7 @@ struct InnerApplication<S> {
impl<S: 'static> Handler for InnerApplication<S> {
fn handle(&self, req: HttpRequest, payload: Option<Payload>) -> Task {
fn handle(&self, req: HttpRequest, payload: Payload) -> Task {
if let Ok(h) = self.router.recognize(req.path()) {
h.handler.handle(req.with_params(h.params), payload, Rc::clone(&self.state))
} else {