SHARE
TWEET

Untitled

a guest Jun 20th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #[derive(Debug)]
  2. enum A {
  3.     B(B),
  4.     C(C),
  5.     A1,
  6.     A2,
  7. }
  8.  
  9. #[derive(Debug)]
  10. enum B {
  11.     B1,
  12.     B2,
  13.     B3,
  14.     B4,
  15.     B5,
  16. }
  17.  
  18. #[derive(Debug)]
  19. enum C {}
  20.  
  21. fn main() {
  22.     let a = A::B(B::B5);
  23.     match a {
  24.         A::B(B::B5) => println!("success"),
  25.         A::B(B::B4) => println!("success"),
  26.         _ => println!("error: {:?}", a),
  27.     }
  28. }
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