summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/checked_conversions.txt
blob: 536b01294ee170493d4c6f6acee6813dbe79a9a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
### What it does
Checks for explicit bounds checking when casting.

### Why is this bad?
Reduces the readability of statements & is error prone.

### Example
```
foo <= i32::MAX as u32;
```

Use instead:
```
i32::try_from(foo).is_ok();
```