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

Remove generic type for request payload, always use default

This commit is contained in:
Nikolay Kim
2019-04-13 14:50:54 -07:00
parent 043f6e77ae
commit 4f30fa9d46
38 changed files with 704 additions and 1207 deletions

View File

@ -88,12 +88,12 @@ impl<T> Clone for Data<T> {
}
}
impl<T: 'static, P> FromRequest<P> for Data<T> {
impl<T: 'static> FromRequest for Data<T> {
type Error = Error;
type Future = Result<Self, Error>;
#[inline]
fn from_request(req: &HttpRequest, _: &mut Payload<P>) -> Self::Future {
fn from_request(req: &HttpRequest, _: &mut Payload) -> Self::Future {
if let Some(st) = req.app_config().extensions().get::<Data<T>>() {
Ok(st.clone())
} else {
@ -232,12 +232,12 @@ impl<T> Clone for RouteData<T> {
}
}
impl<T: 'static, P> FromRequest<P> for RouteData<T> {
impl<T: 'static> FromRequest for RouteData<T> {
type Error = Error;
type Future = Result<Self, Error>;
#[inline]
fn from_request(req: &HttpRequest, _: &mut Payload<P>) -> Self::Future {
fn from_request(req: &HttpRequest, _: &mut Payload) -> Self::Future {
if let Some(st) = req.route_data::<T>() {
Ok(st.clone())
} else {