Option Match
Create a vector of animals ["cat", "dog", "fish"]. Use match with .get() to look up index 1 and index 5. Print what you find!
Expected output:
text
Index 1: dog Index 5: not found
Hints:
- Use
animals.get(1)which returnsOption<&&str> - Match on
Some(animal)andNone
rust
fn main() {
}