Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #[derive(Debug)]
- enum A {
- B(B),
- C(C),
- A1,
- A2,
- }
- #[derive(Debug)]
- enum B {
- B1,
- B2,
- B3,
- B4,
- B5,
- }
- #[derive(Debug)]
- enum C {}
- fn main() {
- let a = A::B(B::B5);
- match a {
- A::B(B::B5) => println!("success"),
- A::B(B::B4) => println!("success"),
- _ => println!("error: {:?}", a),
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement