1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-31 17:07:01 +02:00

Revert "use From/Into instead of custom IntoService and IntoNewService traits"

This reverts commit 9441624827.
This commit is contained in:
Nikolay Kim
2018-09-04 09:49:21 -07:00
parent dfa08b3bf1
commit 0390ff37d3
7 changed files with 72 additions and 25 deletions

View File

@@ -2,7 +2,7 @@ use futures::unsync::mpsc;
use futures::{Async, Future, Poll, Stream};
use tokio::executor::current_thread::spawn;
use super::Service;
use super::{IntoService, Service};
pub struct StreamDispatcher<S: Stream, T> {
stream: S,
@@ -18,12 +18,12 @@ where
T: Service<Request = Result<S::Item, S::Error>, Response = (), Error = ()>,
T::Future: 'static,
{
pub fn new<F: Into<T>>(stream: S, service: F) -> Self {
pub fn new<F: IntoService<T>>(stream: S, service: F) -> Self {
let (stop_tx, stop_rx) = mpsc::unbounded();
StreamDispatcher {
stream,
item: None,
service: service.into(),
service: service.into_service(),
stop_rx,
stop_tx,
}