Update with Poll/Async changes

This commit is contained in:
Alex Crichton
2016-09-02 12:17:38 -07:00
parent 3282b3ec0d
commit 3794cf7f1d
17 changed files with 103 additions and 124 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
use std::io;
use std::time::{Duration, Instant};
use futures::{Future, Poll};
use futures::{Future, Poll, Async};
use LoopHandle;
use io::IoFuture;
@@ -52,10 +52,10 @@ impl Future for Timeout {
// TODO: is this fast enough?
let now = Instant::now();
if *self.token.when() <= now {
Poll::Ok(())
Ok(Async::Ready(()))
} else {
self.handle.update_timeout(&self.token);
Poll::NotReady
Ok(Async::NotReady)
}
}
}