While reading this thread I learned it was possible to unlock new depths of torture with clippy. With this new knowledge I set up bacon's clippy targets to make my life as miserable as possible, and it has certainly been a learning experience.
I had two cases where a sub-library had previously lived in-crate, but once I split it out I had forgot to remove an unneeded dependency.
I had a few cases where I accidentally made Future
s !Send
. This one was actually a little surprising to me at first; for some reason I had imagined that enabling the multithreaded tokio runtime feature would have made using !Send
Futures cause build errors.
I really like seeing ways to rewrite certain if-else statements and iterations. Plain default clippy does this as well, but enabling All The Things™️ makes it suggest even more. Not all of them are better, imho, but the majority definitely have been (at least for me).
However, there are some things that I find to be less useful -- like the "multiple versions of the same crate". I have yet to encounter a case of this where it wasn't out of my control, and the only way to solve it is to go back to older versions until they overlap, which I do not want to do.
I have come to the conclusion that #[must_use]
should be the default for owned return values. It's not always that I agree with clippy's must_use
suggestion, but most of them time I definitely do. And splashing these things all over pollutes the code.
There are a few lints that nag me because they suggest breaking changes. The most common one is probably that is keeps suggesting that passing ownership in s: impl ToString
is bad, and that I should be using s: &impl ToString
instead (which is clearly not a good suggestion). It's kind of annoying to have to manually disable it at each location (because I do want the lint globally).
Oh, also, I want to give a major kudos for the Clippy Lints database, where the link to the source that performs the lint is linked (see View source at the bottom right in this example) -- this is pure genius.
I give this experience a 5/5, not only because it appeals to the OCD part of my brain, but because I genuinely learned new things from it.