Channel poll methods return Poll instead of bool

This commit is contained in:
Ruben De Smet
2023-08-11 11:15:17 +02:00
parent b658f10db9
commit f9d251cd5c
3 changed files with 26 additions and 23 deletions

View File

@ -506,14 +506,7 @@ impl<'c, 'd, T: Instance> CanRx<'c, 'd, T> {
/// Waits while receive queue is empty.
pub async fn wait_not_empty(&mut self) {
poll_fn(|cx| {
if T::state().rx_queue.poll_ready_to_receive(cx) {
Poll::Ready(())
} else {
Poll::Pending
}
})
.await
poll_fn(|cx| T::state().rx_queue.poll_ready_to_receive(cx)).await
}
fn curr_error(&self) -> Option<BusError> {