diff --git a/src/poll.rs b/src/poll.rs index 72050a1c6ef..05d509842d1 100644 --- a/src/poll.rs +++ b/src/poll.rs @@ -35,22 +35,22 @@ impl Async { where F: FnOnce(T) -> U { match self { - Async::NotReady => Async::NotReady, Async::Ready(t) => Async::Ready(f(t)), + Async::NotReady => Async::NotReady, } } - /// Returns whether this is `Async::NotReady` - pub fn is_not_ready(&self) -> bool { + /// Returns whether this is `Async::Ready` + pub fn is_ready(&self) -> bool { match *self { - Async::NotReady => true, - Async::Ready(_) => false, + Async::Ready(_) => true, + Async::NotReady => false, } } - /// Returns whether this is `Async::Ready` - pub fn is_ready(&self) -> bool { - !self.is_not_ready() + /// Returns whether this is `Async::NotReady` + pub fn is_not_ready(&self) -> bool { + !self.is_ready() } } @@ -75,17 +75,17 @@ pub enum AsyncSink { } impl AsyncSink { - /// Returns whether this is `AsyncSink::NotReady` - pub fn is_not_ready(&self) -> bool { + /// Returns whether this is `AsyncSink::Ready` + pub fn is_ready(&self) -> bool { match *self { - AsyncSink::NotReady(_) => true, - AsyncSink::Ready => false, + AsyncSink::Ready => true, + AsyncSink::NotReady(_) => false, } } - /// Returns whether this is `AsyncSink::Ready` - pub fn is_ready(&self) -> bool { - !self.is_not_ready() + /// Returns whether this is `AsyncSink::NotReady` + pub fn is_not_ready(&self) -> bool { + !self.is_ready() } }