Fix building with the event-stream feature (#566)

This commit is contained in:
sigmaSd 2021-05-06 10:28:07 +01:00 committed by GitHub
parent 176d8beb06
commit b31782249e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 8 deletions

View File

@ -151,8 +151,7 @@ impl EventSource for UnixInternalEventSource {
return Err(std::io::Error::new( return Err(std::io::Error::new(
std::io::ErrorKind::Interrupted, std::io::ErrorKind::Interrupted,
"Poll operation was woken up by `Waker::wake`", "Poll operation was woken up by `Waker::wake`",
) ));
.into());
} }
_ => unreachable!("Synchronize Evented handle registration & token handling"), _ => unreachable!("Synchronize Evented handle registration & token handling"),
} }

View File

@ -2,7 +2,7 @@ use std::sync::{Arc, Mutex};
use mio::{Registry, Token}; use mio::{Registry, Token};
use crate::{ErrorKind, Result}; use crate::Result;
/// Allows to wake up the `mio::Poll::poll()` method. /// Allows to wake up the `mio::Poll::poll()` method.
/// This type wraps `mio::Waker`, for more information see its documentation. /// This type wraps `mio::Waker`, for more information see its documentation.
@ -23,11 +23,7 @@ impl Waker {
/// ///
/// Readiness is set to `Ready::readable()`. /// Readiness is set to `Ready::readable()`.
pub(crate) fn wake(&self) -> Result<()> { pub(crate) fn wake(&self) -> Result<()> {
self.inner self.inner.lock().unwrap().wake()
.lock()
.unwrap()
.wake()
.map_err(ErrorKind::IoError)
} }
/// Resets the state so the same waker can be reused. /// Resets the state so the same waker can be reused.