2 Checks for casts between numerical types that may
3 be replaced by safe conversion functions.
6 Rust's `as` keyword will perform many kinds of
7 conversions, including silently lossy conversions. Conversion functions such
8 as `i32::from` will only perform lossless conversions. Using the conversion
9 functions prevents conversions from turning into silent lossy conversions if
10 the types of the input expressions ever change, and make it easier for
11 people reading the code to know that the conversion is lossless.
15 fn as_u64(x: u8) -> u64 {
20 Using `::from` would look like this:
23 fn as_u64(x: u8) -> u64 {