I'm learning Rust.
I'm using .to_digit() to cast a char to an integer, but I cannot match the casted value afterwards. Any help is appreciated!
let c: char = '2';
let to_num = c.to_digit(10);
match to_num {
Some(2) => {println!("matched")},
None => {},
}
Error: patterns Some(0u32..=1u32) and Some(3u32..=std::u32::MAX) not covered