I'm unsure if I'm holding the new interface wrong somehow or if I've encountered a bug.
Given this diff that attempts to track the event-listener interface changes, I'm encountering a deterministic panic like:
event-listener-5.2.0/src/lib.rs:1251:36:
listener was never inserted into the list
and as far as I can tell the code reduces to
let n = AtomicUsize::from(1);
let event = Event::new();
let mut listener = event.listen();
loop {
if 0 == n.load(Ordering::SeqCst) {
return Poll::Ready(());
};
ready!(Pin::new(&mut listener).poll(cx));
}
Do I need to replace the listener every time I poll it? Am I holding this wrong? Is this a bug?
If I'm using it wrong I'll happily contribute documentation to help others avoid this error