5 ms·
Not OP, but what happens in the case you want to add by subtracting a negative value?
by scoutt 5y ago
Not OP, but what happens in the case you want to add by subtracting a negative value?
- gpm 5y agoYou disable the warning for the function?
- dureuill 5y agoYes, which also serves as a way to explicitly point out that the "surprising operation" is intended. Hopefully this even reminds you of putting an explanatory comment there.
- doteka 5y agoKnowing clippy I wouldn’t be surprised if that compiled, but resulted in a warning that you can simplify the double negative.
- vurpo 5y agoClippy is a linter. You don't use linters by mechanically following its warnings as gospel, you use it by double-checking the code wherever it warns and removing the warning from that function if it's a false positive.