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

rename FromRequest trait to Responder

This commit is contained in:
Nikolay Kim
2017-12-14 09:43:42 -08:00
parent 355f54efe2
commit c98d320f8c
9 changed files with 76 additions and 72 deletions

View File

@@ -3,7 +3,7 @@
use http::{StatusCode, Error as HttpError};
use body::Body;
use handler::{Reply, Handler, RouteHandler, FromRequest};
use handler::{Reply, Handler, RouteHandler, Responder};
use httprequest::HttpRequest;
use httpresponse::{HttpResponse, HttpResponseBuilder};
@@ -81,11 +81,11 @@ impl<S> RouteHandler<S> for StaticResponse {
}
}
impl FromRequest for StaticResponse {
impl Responder for StaticResponse {
type Item = HttpResponse;
type Error = HttpError;
fn from_request(self, _: HttpRequest) -> Result<HttpResponse, HttpError> {
fn respond_to(self, _: HttpRequest) -> Result<HttpResponse, HttpError> {
self.build().body(Body::Empty)
}
}