]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/src/docs/checked_conversions.txt
:arrow_up: rust-analyzer
[rust.git] / src / tools / clippy / src / docs / checked_conversions.txt
1 ### What it does
2 Checks for explicit bounds checking when casting.
3
4 ### Why is this bad?
5 Reduces the readability of statements & is error prone.
6
7 ### Example
8 ```
9 foo <= i32::MAX as u32;
10 ```
11
12 Use instead:
13 ```
14 i32::try_from(foo).is_ok();
15 ```