mirror of
https://github.com/fafhrd91/actix-web
synced 2025-08-30 08:38:16 +02:00
refactor response generation
This commit is contained in:
@@ -9,7 +9,7 @@ use route::RouteHandler;
|
||||
use resource::Resource;
|
||||
use application::Application;
|
||||
use httpcodes::HTTPNotFound;
|
||||
use httpmessage::{HttpRequest, IntoHttpResponse};
|
||||
use httpmessage::HttpRequest;
|
||||
|
||||
pub(crate) trait Handler: 'static {
|
||||
fn handle(&self, req: HttpRequest, payload: Payload) -> Task;
|
||||
@@ -138,7 +138,7 @@ impl Router {
|
||||
return app.handle(req, payload)
|
||||
}
|
||||
}
|
||||
Task::reply(IntoHttpResponse::response(HTTPNotFound, req))
|
||||
Task::reply(req, HTTPNotFound.response())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user