Exerpad
🔥0
0 XP
Lv.1 Beginner
Log In

Option Finder

Create a vector of strings: ["apple", "banana", "cherry"].

Use the .get() method to look up index 1 and store it in a variable.

Then use match to handle the Option:

  • Some(value) => print Found: followed by the value
  • None => print Not found

Expected output:

Found: banana

rust
fn main() {
}