Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- let deep_wrapped: Option<Option<Option<String>>> = Some(Some(Some("hello".to_string())));
- // let unwrapped1 = deep_wrapped.expect("None in depth 1!");
- // let unwrapped2 = unwrapped1.expect("None in depth 2!");
- // let unwrapped3 = unwrapped2.expect("None in depth 3!");
- // println!("{}", unwrapped3);
- if let Some(unwrapped1) = deep_wrapped {
- if let Some(unwrapped2) = unwrapped1 {
- if let Some(unwrapped3) = unwrapped2 {
- println!("{}", unwrapped3);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement