Remove let _ pattern

This commit is contained in:
Stjepan Glavina 2020-09-13 13:41:08 +02:00
parent 5e135a8a7b
commit 82c7e59107
4 changed files with 10 additions and 12 deletions

View File

@ -700,7 +700,7 @@ impl<T> Drop for Async<T> {
fn drop(&mut self) {
if self.io.is_some() {
// Deregister and ignore errors because destructors should not panic.
let _ = Reactor::get().remove_io(&self.source);
Reactor::get().remove_io(&self.source).ok();
// Drop the I/O handle to close it.
self.io.take();
@ -1195,9 +1195,7 @@ impl Async<UnixListener> {
/// }
/// # std::io::Result::Ok(()) });
/// ```
pub fn incoming(
&self,
) -> impl Stream<Item = io::Result<Async<UnixStream>>> + Send + '_ {
pub fn incoming(&self) -> impl Stream<Item = io::Result<Async<UnixStream>>> + Send + '_ {
stream::unfold(self, |listener| async move {
let res = listener.accept().await.map(|(stream, _)| stream);
Some((res, listener))

View File

@ -112,7 +112,7 @@ impl Reactor {
if let Some(mut reactor_lock) = reactor_lock {
log::trace!("main_loop: waiting on I/O");
let _ = reactor_lock.react(None);
reactor_lock.react(None).ok();
last_tick = self.ticker.load(Ordering::SeqCst);
sleeps = 0;
}
@ -197,7 +197,7 @@ impl Reactor {
});
// Process available I/O events.
let _ = reactor_lock.react(Some(Duration::from_secs(0)));
reactor_lock.react(Some(Duration::from_secs(0))).ok();
}
continue;
}
@ -225,7 +225,7 @@ impl Reactor {
// Wait for I/O events.
log::trace!("block_on: waiting on I/O");
let _ = reactor_lock.react(None);
reactor_lock.react(None).ok();
// Check if a notification has been received.
if p.park_timeout(Duration::from_secs(0)) {
@ -504,7 +504,7 @@ impl ReactorLock<'_> {
log::trace!("react: {} ready wakers", wakers.len());
for waker in wakers {
// Don't let a panicking waker blow everything up.
let _ = panic::catch_unwind(|| waker.wake());
panic::catch_unwind(|| waker.wake()).ok();
}
res
@ -695,7 +695,7 @@ fn limit_waker_list(wakers: &mut Vec<Waker>) -> bool {
log::trace!("limit_waker_list: clearing the list");
for waker in wakers.drain(..) {
// Don't let a panicking waker blow everything up.
let _ = panic::catch_unwind(|| waker.wake());
panic::catch_unwind(|| waker.wake()).ok();
}
true
} else {

View File

@ -26,7 +26,7 @@ fn spawn<T: Send + 'static>(
thread::spawn(move || {
future::block_on(async {
let _ = s.send(f.await).await;
s.send(f.await).await.ok();
})
});

View File

@ -14,7 +14,7 @@ fn spawn<T: Send + 'static>(
thread::spawn(move || {
future::block_on(async {
let _ = s.send(f.await).await;
s.send(f.await).await.ok();
})
});
@ -46,7 +46,7 @@ fn poll_across_tasks() {
.or(async {})
.await;
let _ = sender.send(timer).await;
sender.send(timer).await.ok();
});
let task2 = spawn(async move {