`tokio::sync::broadcast` channel nested pattern matching receive problem

I'm confused with broadcast channel, all work as expected when we use:

while let Ok(e) = rx.recv().await {
  if let AppEvent::Ping(i) = e else { continue; }
  println!("got ping: {i}");
  tx.send(AppEvent::Pong(i)).unwrap();
}

but if we add patter match for enum like this in while loop:

while let Ok(AppEvent::Ping(i)) = rx.recv().await {
  println!("got ping: {i}");
  tx.send(AppEvent::Pong(i)).unwrap();
}

we receive only one Ping message and Pong on other site with same loop will not be received.
Just look at examples:

Working example:

Failing example:

I know broadcast receivers not receive previous messages, but they already subscribe on time we send Pong. What I miss in broadcast implementation?

Your second loop will only run as long as the channel produces Ping values. As soon as rx.recv() returns a Pong, the let pattern won't match, so the loop will terminate, and any Pings after that will be ignored.