1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-09-02 07:16:37 +02:00

better ergonomics for aply combinator

This commit is contained in:
Nikolay Kim
2018-09-17 16:16:42 -07:00
parent a4ba7cd5d4
commit a91b9a2f9e
2 changed files with 13 additions and 8 deletions

View File

@@ -2,7 +2,7 @@ use std::marker::PhantomData;
use futures::{Async, Future, IntoFuture, Poll};
use super::{IntoNewService, NewService, Service};
use super::{IntoNewService, IntoService, NewService, Service};
/// `Apply` service combinator
pub struct Apply<T, F, R, Req> {
@@ -19,9 +19,9 @@ where
R: IntoFuture,
{
/// Create new `Apply` combinator
pub fn new(service: T, f: F) -> Self {
pub fn new<I: IntoService<T>>(service: I, f: F) -> Self {
Self {
service,
service: service.into_service(),
f,
r: PhantomData,
}