Skip to main content
Journey Uncommon Logo
JourneyUncommon
easyRustmatch and exhaustivenessSingle-choice MCQ

In Rust, what does matching on a reference like `&Some(ref x)` or using `match &opt` let you do?

let opt = Some(String::from("hi")); let len = match &opt { Some(s) => s.len(), None => 0, }; println!("{}", opt.is_some());