Module 9: Enums And Pattern Matching
Check your understanding
A quick multiple-choice check before you move on. Answer every question, then submit to see how you did.
1.How does a Rust enum differ from a C# enum?
2.What does Option<T> express, and why does Rust use it?
3.Inside a function returning Result<i32, E>, what does let x = a.parse::<i32>()?; do when parse returns Err(e)?
4.Why does the compiler reject a match on an enum that omits one of its variants?
5.You have let opt: Option<i32> = Some(5); and only care about the Some case. Which is the most idiomatic?
Answer every question to submit.