1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-12-22 08:07:18 +00:00

convert to new service

This commit is contained in:
Nikolay Kim 2018-08-30 09:38:09 -07:00
parent a928d82895
commit 061a0339ff

View file

@ -1,7 +1,7 @@
use std::marker::PhantomData;
use futures::{Async, Future, Poll};
use {NewService, Service};
use {NewService, Service, IntoNewService};
/// `ApplyService` service combinator
pub struct ApplyService<T, F, R, Req, Resp, Err> {
@ -70,10 +70,10 @@ where
R: Future<Item = Resp, Error = Err>,
{
/// Create new `Partial` new service instance
pub fn new(f: F, service: T) -> Self {
pub fn new<F1: IntoNewService<T>>(f: F, service: F1) -> Self {
Self {
service,
f,
service: service.into_new_service(),
r: PhantomData,
r1: PhantomData,
r2: PhantomData,