Update to futures 0.2.0-beta (#246)

This commit is contained in:
Aaron Turon
2018-03-21 14:21:02 -07:00
committed by Carl Lerche
parent 494f0dc176
commit 8786741ba9
6 changed files with 21 additions and 7 deletions
+14 -2
View File
@@ -16,7 +16,13 @@ use futures::future::lazy;
#[cfg(feature = "unstable-futures")]
use futures2::prelude::*;
#[cfg(feature = "unstable-futures")]
use futures2::future::lazy;
fn lazy<R, F>(f: F) -> Box<Future<Item = R::Item, Error = R::Error> + Send> where
F: Send + 'static + FnOnce() -> R,
R: Send + 'static + IntoFuture,
R::Future: Send,
{
Box::new(::futures2::future::lazy(|_| f()))
}
use std::cell::Cell;
use std::sync::{mpsc, Arc};
@@ -416,7 +422,13 @@ fn many_multishot_futures() {
}
for final_rx in final_rxs {
block_on(final_rx.into_future()).unwrap();
{#![cfg(feature = "unstable-futures")]
block_on(final_rx.next()).unwrap();
}
{#![cfg(not(feature = "unstable-futures"))]
block_on(final_rx.into_future()).unwrap();
}
}
// Shutdown the pool