Closed
Description
Writing a while-let loop for e. g. an event loop triggers a compiler warning:
warning: irrefutable while-let pattern
--> src/main.rs:34:5
|
34 | / while let e = crossterm::event::read()? {
35 | | // code
36 | | }
| |_____^
|
= note: `#[warn(irrefutable_let_patterns)]` on by default
There's no error code, and no further information, so it isn't the easiest to investigate as a user.
In my case, I believe it's warning about potentially running an unintentionally infinite/indefinite loop, which in my case is intentional. So my guess would be that I am OK to #[allow] it - at a guess.
I would suggest that additional notes be added to this warning detailing why it's a potential problem