Skip to content

Commit

Permalink
Provide Send Futures
Browse files Browse the repository at this point in the history
This would be better with rust-lang/rust#63063
  • Loading branch information
jonhoo committed Sep 12, 2019
1 parent cb596f0 commit 997e771
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/multiplex/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ where
NT::Item: 'static + Send,
NT::SinkError: 'static + Send + Sync,
NT::Error: 'static + Send + Sync,
NT::Future: 'static,
NT::Future: 'static + Send,
{
type Error = SpawnError<NT::MakeError>;
type Response = Client<NT::Transport, Error<NT::Transport, Request>, Request>;
type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>>>>;
type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send>>;

fn call(&mut self, target: Target) -> Self::Future {
let maker = self.t_maker.make_transport(target);
Expand Down Expand Up @@ -349,7 +349,7 @@ where
{
type Response = T::Ok;
type Error = E;
type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>>>>;
type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send>>;

fn poll_ready(&mut self, cx: &mut Context) -> Poll<Result<(), E>> {
Poll::Ready(ready!(self.mediator.poll_ready(cx)).map_err(|_| E::from(Error::ClientDropped)))
Expand Down
6 changes: 3 additions & 3 deletions src/pipeline/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ where
NT::Item: 'static + Send,
NT::SinkError: 'static + Send + Sync,
NT::Error: 'static + Send + Sync,
NT::Future: 'static,
NT::Future: 'static + Send,
{
type Error = SpawnError<NT::MakeError>;
type Response = Client<NT::Transport, Error<NT::Transport, Request>, Request>;
type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>>>>;
type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send>>;

fn call(&mut self, target: Target) -> Self::Future {
let maker = self.t_maker.make_transport(target);
Expand Down Expand Up @@ -308,7 +308,7 @@ where
{
type Response = T::Ok;
type Error = E;
type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>>>>;
type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send>>;

fn poll_ready(&mut self, cx: &mut Context) -> Poll<Result<(), E>> {
Poll::Ready(ready!(self.mediator.poll_ready(cx)).map_err(|_| E::from(Error::ClientDropped)))
Expand Down

0 comments on commit 997e771

Please sign in to comment.