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"),
}
}
A u8 holds whole numbers from 0 through 255. Decide which Result variant the parser returns for 256.