mirror of
https://github.com/fafhrd91/actix-web
synced 2025-08-31 17:07:01 +02:00
refactor payload
This commit is contained in:
@@ -4,7 +4,8 @@ use std::rc::Rc;
|
||||
use http::StatusCode;
|
||||
|
||||
use task::Task;
|
||||
use route::{Payload, RouteHandler};
|
||||
use route::RouteHandler;
|
||||
use payload::Payload;
|
||||
use httpmessage::{Body, HttpRequest, HttpResponse, IntoHttpResponse};
|
||||
|
||||
pub const HTTPOk: StaticResponse = StaticResponse(StatusCode::OK);
|
||||
@@ -25,8 +26,7 @@ impl StaticResponse {
|
||||
}
|
||||
|
||||
impl<S> RouteHandler<S> for StaticResponse {
|
||||
fn handle(&self, req: HttpRequest, _: Option<Payload>, _: Rc<S>) -> Task
|
||||
{
|
||||
fn handle(&self, req: HttpRequest, _: Payload, _: Rc<S>) -> Task {
|
||||
Task::reply(HttpResponse::new(req, self.0, Body::Empty))
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user