]> git.proxmox.com Git - rustc.git/blob - src/tools/clippy/src/docs/neg_multiply.txt
New upstream version 1.65.0+dfsg1
[rustc.git] / src / tools / clippy / src / docs / neg_multiply.txt
1 ### What it does
2 Checks for multiplication by -1 as a form of negation.
3
4 ### Why is this bad?
5 It's more readable to just negate.
6
7 ### Known problems
8 This only catches integers (for now).
9
10 ### Example
11 ```
12 let a = x * -1;
13 ```
14
15 Use instead:
16 ```
17 let a = -x;
18 ```