Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
328
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. fn main() {
  2. let deep_wrapped: Option<Option<Option<String>>> = Some(Some(Some("hello".to_string())));
  3.  
  4. let unwrapped1 = deep_wrapped.expect("None in depth 1!");
  5. let unwrapped2 = unwrapped1.expect("None in depth 2!");
  6. let unwrapped3 = unwrapped2.expect("None in depth 3!");
  7.  
  8. println!("{}", unwrapped3);
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement