summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/neg_multiply.txt
blob: 4e8b096eb9cc74b90077cae1b66e7157e745f40a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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;
```