The `as` operator explicitly casts a value to another permitted type. Rust requires compatible types before comparing values, so casting can make operands comparable. section 2.3.3
Cast before comparing
With `a: i32` and `b: u16`, `if a < b` does not compile. Cast the smaller value to `i32`: `if a < (b as i32) { println!("Ten is less than one hundred."); }` section 2.3.3
Use casts carefully:
- Prefer converting a smaller integer type to a larger one, such as `u16` to `i32`; narrowing conversions are riskier. section 2.3.3
- Expect surprising results from careless narrowing: `300_i32 as i8` produces `44`. section 2.3.3
- Use `try_into()` with `Result` when a conversion may fail and `as` is too restrictive. section 2.3.3


