All games

Result Rescue

Predict parse outcomes and recover from invalid input.

Challenge 1 of 3Score 0 / 3

Which message appears when the input is too large for a u8?

main.rs
fn main() {
    let result = "256".parse::<u8>();
    match result {
        Ok(n) => println!("Number: {n}"),
        Err(_) => println!("Invalid value"),
    }
}
Choose the output
Back to the lesson