A cast uses `as` to turn a value into another type. Rust keeps types distinct, even when both are integers. For example, a `u8` can be cast to a `char`: values from 0 to 255 include numbers assigned to common characters. section 1.3
fn main() {
let my_number = 100;
println!("{}", my_number as u8 as char);
}
Here, `my_number` is first cast from `i32` to `u8`, then from `u8` to `char`. Casting it directly from `i32` to `char` produces a compiler error. The value 100 prints as `d`. section 1.3
Check the destination type’s range before casting. A `u8` holds 0 through 255, but casting 256 to `u8` gives 0—not 255. section 1.3




















