1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-12-21 23:56:35 +00:00

remove unneeded phantom data

This commit is contained in:
Nikolay Kim 2018-09-06 18:03:01 -07:00
parent 0525da70bf
commit d917b47868
3 changed files with 11 additions and 41 deletions

View file

@ -7,7 +7,7 @@ use {IntoNewService, NewService, Service};
pub struct Apply<T, F, R, Req> {
service: T,
f: F,
r: PhantomData<Fn(Req) -> R>,
r: PhantomData<(Req, R)>,
}
impl<T, F, R, Req> Apply<T, F, R, Req>

View file

@ -14,9 +14,7 @@ where
Fut: IntoFuture<Item = Resp, Error = E>,
{
f: F,
req: marker::PhantomData<Req>,
resp: marker::PhantomData<Resp>,
err: marker::PhantomData<E>,
_t: marker::PhantomData<(Req, Resp, E)>,
}
impl<F, Req, Resp, E, Fut> FnService<F, Req, Resp, E, Fut>
@ -27,9 +25,7 @@ where
pub fn new(f: F) -> Self {
FnService {
f,
req: marker::PhantomData,
resp: marker::PhantomData,
err: marker::PhantomData,
_t: marker::PhantomData,
}
}
}
@ -42,9 +38,7 @@ where
fn clone(&self) -> Self {
FnService {
f: self.f.clone(),
req: marker::PhantomData,
resp: marker::PhantomData,
err: marker::PhantomData,
_t: marker::PhantomData,
}
}
}
@ -84,10 +78,7 @@ where
Fut: IntoFuture<Item = Resp, Error = Err>,
{
f: F,
req: marker::PhantomData<Req>,
resp: marker::PhantomData<Resp>,
err: marker::PhantomData<Err>,
ierr: marker::PhantomData<IErr>,
_t: marker::PhantomData<(Req, Resp, Err, IErr)>,
}
impl<F, Req, Resp, Err, IErr, Fut> FnNewService<F, Req, Resp, Err, IErr, Fut>
@ -98,10 +89,7 @@ where
pub fn new(f: F) -> Self {
FnNewService {
f,
req: marker::PhantomData,
resp: marker::PhantomData,
err: marker::PhantomData,
ierr: marker::PhantomData,
_t: marker::PhantomData,
}
}
}

View file

@ -12,9 +12,7 @@ where
{
f: F,
state: S,
req: marker::PhantomData<Req>,
resp: marker::PhantomData<Resp>,
err: marker::PhantomData<Err>,
_t: marker::PhantomData<(Req, Resp, Err)>,
}
impl<S, F, Req, Resp, Err, Fut> FnStateService<S, F, Req, Resp, Err, Fut>
@ -26,9 +24,7 @@ where
FnStateService {
f,
state,
req: marker::PhantomData,
resp: marker::PhantomData,
err: marker::PhantomData,
_t: marker::PhantomData,
}
}
}
@ -43,9 +39,7 @@ where
FnStateService {
f: self.f.clone(),
state: self.state.clone(),
req: marker::PhantomData,
resp: marker::PhantomData,
err: marker::PhantomData,
_t: marker::PhantomData,
}
}
}
@ -73,13 +67,7 @@ where
pub struct FnStateNewService<S, F1, F2, Req, Resp, Err1, Err2, Fut1, Fut2> {
f: F1,
state: F2,
s: marker::PhantomData<S>,
req: marker::PhantomData<Req>,
resp: marker::PhantomData<Resp>,
err1: marker::PhantomData<Err1>,
err2: marker::PhantomData<Err2>,
fut1: marker::PhantomData<Fut1>,
fut2: marker::PhantomData<Fut2>,
_t: marker::PhantomData<(S, Req, Resp, Err1, Err2, Fut1, Fut2)>,
}
impl<S, F1, F2, Req, Resp, Err1, Err2, Fut1, Fut2>
@ -89,13 +77,7 @@ impl<S, F1, F2, Req, Resp, Err1, Err2, Fut1, Fut2>
FnStateNewService {
f,
state,
s: marker::PhantomData,
req: marker::PhantomData,
resp: marker::PhantomData,
err1: marker::PhantomData,
err2: marker::PhantomData,
fut1: marker::PhantomData,
fut2: marker::PhantomData,
_t: marker::PhantomData,
}
}
}