daily pastebin goal
47%
SHARE
TWEET

Untitled

a guest Jul 19th, 2018 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. enum CustomError {
  2.     First(u32),
  3.     Second(u8),
  4. }
  5.  
  6. fn main()
  7. {
  8.     let x: Result<(), CustomError> = Err(CustomError::First(33));
  9.     assert!(if let Err(CustomError::First(_)) = x { true } else { false });
  10.     assert!(match x { Err(CustomError::First(_)) => true, _ => false });
  11. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top