The code is taken from the translation of The Rust Programming Language, section Templates .
struct Person { name: Option<String>, } let name = "Steve".to_string(); let mut x: Option<Person> = Some(Person { name: Some(name) }); match x { Some(Person { name: ref a @ Some(_), .. }) => println!("{:?}", a), _ => {} } I do not understand where Some came from and what it all is. Maybe I missed something and now I do not understand. Explain what it is and how useful such a construct is in this code. Person structure, but why do we put it in Some?