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:
@@ -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,
|
||||
}
|
||||
|
Reference in New Issue
Block a user