Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Jul 19th, 2018 58 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  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