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

use From/Into instead of custom IntoService and IntoNewService traits

This commit is contained in:
Nikolay Kim
2018-09-04 09:30:52 -07:00
parent 42a49da199
commit 9441624827
7 changed files with 25 additions and 72 deletions

View File

@@ -1,7 +1,8 @@
use std::marker::PhantomData;
use futures::{Async, Future, IntoFuture, Poll};
use {IntoNewService, NewService, Service};
use {NewService, Service};
/// `Apply` service combinator
pub struct Apply<T, F, R, Req> {
@@ -62,10 +63,10 @@ where
R: IntoFuture,
{
/// Create new `ApplyNewService` new service instance
pub fn new<F1: IntoNewService<T>>(f: F, service: F1) -> Self {
pub fn new<F1: Into<T>>(f: F, service: F1) -> Self {
Self {
f,
service: service.into_new_service(),
service: service.into(),
r: PhantomData,
}
}