Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #[derive(Debug)]
- enum Foo {
- A,
- B,
- C
- }
- impl Foo {
- fn testing(&self) -> u8 {
- match self {
- Foo::A => 0,
- Foo::B => 1,
- Foo::C => 2,
- }
- }
- }
- fn main() {
- let bar = Foo::A;
- println!("{:?}", bar.testing());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement