xxxxxxxxxx
const RADIX: u32 = 10;
let x = "134";
println!("{}", x.chars().map(|c| c.to_digit(RADIX).unwrap()).sum::<u32>());
xxxxxxxxxx
fn main() {
let character: char = 'A';
// convert char type to u8 integer type
let integer = char as u8;
println!("character = {}", character);
println!("integer = {}", integer); // prints 65 because in Unicode, A=65
}