summaryrefslogtreecommitdiff
path: root/cli/global_timer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/global_timer.rs')
-rw-r--r--cli/global_timer.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/cli/global_timer.rs b/cli/global_timer.rs
index d3ca52f46..9ab760ab4 100644
--- a/cli/global_timer.rs
+++ b/cli/global_timer.rs
@@ -9,9 +9,10 @@
//! calls it) for an entire Isolate. This is what is implemented here.
use crate::tokio_util::panic_on_error;
-use futures::Future;
+use futures::channel::oneshot;
+use futures::future::FutureExt;
+use std::future::Future;
use std::time::Instant;
-use tokio::sync::oneshot;
use tokio::timer::Delay;
#[derive(Default)]
@@ -33,7 +34,7 @@ impl GlobalTimer {
pub fn new_timeout(
&mut self,
deadline: Instant,
- ) -> impl Future<Item = (), Error = ()> {
+ ) -> impl Future<Output = Result<(), ()>> {
if self.tx.is_some() {
self.cancel();
}
@@ -42,9 +43,10 @@ impl GlobalTimer {
let (tx, rx) = oneshot::channel();
self.tx = Some(tx);
- let delay = panic_on_error(Delay::new(deadline));
+ let delay =
+ panic_on_error(futures::compat::Compat01As03::new(Delay::new(deadline)));
let rx = panic_on_error(rx);
- delay.select(rx).then(|_| Ok(()))
+ futures::future::select(delay, rx).then(|_| futures::future::ok(()))
}
}