summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/unnecessary_cast.txt
blob: 603f2606099c8317e4c0ffda8d0c86e58565768e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
### What it does
Checks for casts to the same type, casts of int literals to integer types
and casts of float literals to float types.

### Why is this bad?
It's just unnecessary.

### Example
```
let _ = 2i32 as i32;
let _ = 0.5 as f32;
```

Better:

```
let _ = 2_i32;
let _ = 0.5_f32;
```