Update to crossbeam-queue v0.3.11

This commit is contained in:
Philipp Oppermann
2024-05-30 11:03:30 +02:00
parent a2ca911f4e
commit df2c149e79
4 changed files with 9 additions and 27 deletions

View File

@@ -51,17 +51,17 @@ impl Stream for ScancodeStream {
.expect("scancode queue not initialized");
// fast path
if let Ok(scancode) = queue.pop() {
if let Some(scancode) = queue.pop() {
return Poll::Ready(Some(scancode));
}
WAKER.register(&cx.waker());
match queue.pop() {
Ok(scancode) => {
Some(scancode) => {
WAKER.take();
Poll::Ready(Some(scancode))
}
Err(crossbeam_queue::PopError) => Poll::Pending,
None => Poll::Pending,
}
}
}