When should code be tweaked to comply with Clippy lints?

My argument was not about code bing objectively best or better. It was a claim that it would be objectively better if we all used the same style and idioms all the time everywhere. Thus reducing cognitive load on everyone reading and writing the code.

Every now and then somebody posts a question here asking like "what is the idiomatic way to do X is Rust?". Then comes twenty replies demonstrating 20 different ways to do it. Maybe I'm slow but typically I find most of the suggestions not immediately obvious or down right obscure. That is cognitive load I don't need and wastes time. Example: Idiomatic way to avoid match - #13 by arnie

Then I think it, would it not be great if everyone did that kind of thing the same kind of way? Then, even if I don't like how it looks I only have to get my head around it once. Less fuss less muss.

Which is why I campaign for everyone biting the bullet and doing as clippy suggests.

Far from hostile, the intent is to make life easy for everyone. Especially those new to Rust that won't immediately be familiar with every obscure way a thing can be done. Like me. Still after two years.

4 Likes