summaryrefslogtreecommitdiffstats
path: root/tokio-reactor/src/poll_evented.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tokio-reactor/src/poll_evented.rs')
-rw-r--r--tokio-reactor/src/poll_evented.rs17
1 files changed, 9 insertions, 8 deletions
diff --git a/tokio-reactor/src/poll_evented.rs b/tokio-reactor/src/poll_evented.rs
index 230f7c34..140ac4ca 100644
--- a/tokio-reactor/src/poll_evented.rs
+++ b/tokio-reactor/src/poll_evented.rs
@@ -1,14 +1,12 @@
-use {Handle, Registration};
-
-use futures::{task, Async, Poll};
+use crate::{Handle, Registration};
+use futures::{task, try_ready, Async, Poll};
use mio;
use mio::event::Evented;
-use tokio_io::{AsyncRead, AsyncWrite};
-
use std::fmt;
use std::io::{self, Read, Write};
use std::sync::atomic::AtomicUsize;
use std::sync::atomic::Ordering::Relaxed;
+use tokio_io::{AsyncRead, AsyncWrite};
/// Associates an I/O resource that implements the [`std::io::Read`] and/or
/// [`std::io::Write`] traits with the reactor that drives it.
@@ -108,7 +106,7 @@ macro_rules! poll_ready {
// Load cached & encoded readiness.
let mut cached = $me.inner.$cache.load(Relaxed);
- let mask = $mask | ::platform::hup();
+ let mask = $mask | crate::platform::hup();
// See if the current readiness matches any bits.
let mut ret = mio::Ready::from_usize(cached) & $mask;
@@ -248,7 +246,10 @@ where
pub fn clear_read_ready(&self, ready: mio::Ready) -> io::Result<()> {
// Cannot clear write readiness
assert!(!ready.is_writable(), "cannot clear write readiness");
- assert!(!::platform::is_hup(&ready), "cannot clear HUP readiness");
+ assert!(
+ !crate::platform::is_hup(&ready),
+ "cannot clear HUP readiness"
+ );
self.inner
.read_readiness
@@ -473,7 +474,7 @@ fn is_wouldblock<T>(r: &io::Result<T>) -> bool {
}
impl<E: Evented + fmt::Debug> fmt::Debug for PollEvented<E> {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("PollEvented").field("io", &self.io).finish()
}
}