diff options
Diffstat (limited to 'src/poll.rs')
-rw-r--r-- | src/poll.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/poll.rs b/src/poll.rs index b06f138..a6f4ab0 100644 --- a/src/poll.rs +++ b/src/poll.rs @@ -361,7 +361,7 @@ cfg_os_poll! { #[cfg(unix)] impl AsRawFd for Poll { fn as_raw_fd(&self) -> RawFd { - self.registry.selector.as_raw_fd() + self.registry.as_raw_fd() } } @@ -528,7 +528,7 @@ impl Registry { /// // the token is the same it must be specified. /// poll.registry().reregister( /// &mut socket, - /// Token(2), + /// Token(0), /// Interest::WRITABLE)?; /// # Ok(()) /// # } @@ -636,6 +636,13 @@ impl fmt::Debug for Registry { } } +#[cfg(unix)] +impl AsRawFd for Registry { + fn as_raw_fd(&self) -> RawFd { + self.selector.as_raw_fd() + } +} + /// Get access to the `sys::Selector` from `Registry`. pub(crate) fn selector(registry: &Registry) -> &sys::Selector { ®istry.selector |