Guest User

Untitled

a guest
Oct 18th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.16 KB | None | 0 0
  1. #![allow(unused)]
  2. fn main() {
  3. fn count(x: &str) -> usize { x.len() }
  4.  
  5. assert_eq!(Ok(2).unwrap_or_else(count), 2);
  6. assert_eq!(Err("foo").unwrap_or_else(count), 3);
  7. }
Add Comment
Please, Sign In to add comment