1
0
mirror of https://github.com/fafhrd91/actix-net synced 2024-11-24 02:21:07 +01: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,