diff options
Diffstat (limited to 'src/tools/clippy/src/docs/neg_multiply.txt')
-rw-r--r-- | src/tools/clippy/src/docs/neg_multiply.txt | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/neg_multiply.txt b/src/tools/clippy/src/docs/neg_multiply.txt new file mode 100644 index 000000000..4e8b096eb --- /dev/null +++ b/src/tools/clippy/src/docs/neg_multiply.txt @@ -0,0 +1,18 @@ +### What it does +Checks for multiplication by -1 as a form of negation. + +### Why is this bad? +It's more readable to just negate. + +### Known problems +This only catches integers (for now). + +### Example +``` +let a = x * -1; +``` + +Use instead: +``` +let a = -x; +```
\ No newline at end of file |