Exerpad
🔥0
0 XP
Lv.1 Beginner
Log In

Fix the Option

This program tries to get a value from a vector, but it doesn't handle the None case!

Fix the code so it properly handles both Some and None using match.

Hint: The .get() method returns an Option. You need to match on both Some(value) and None.

rust
fn main() {
let scores = vec![100, 85, 92];
let result = scores.get(0);

if result {
println!("Score: {}", result);
}
}