Closed tirix closed 2 years ago
Regarding the clippy lint, I noticed this one in one of my cleanup PRs earlier and decided not to apply it, although I think it was nightly at the time so I couldn't #[allow]
it. The reasoning is that the original code is shorter and is effectively emulating a do-while loop in rust, and also IIRC this example was reported on clippy and it might get less aggressive about this case in the future. (Otherwise LGTM.)
I can revert it : the do-while loop is indeed quite readable.
Did you mean to allow that lint just for that function, or the whole lib.rs
?
Either one is fine by me. Turning it off globally is probably fine since the lint is also wrong (it is suggesting moving the condition out of the loop), so it will probably get fixed upstream at some point.
Note: the second commit has nothing to do with the PR title, but is only due to a new clippy lint which appeared recently.