Created
December 24, 2020 01:04
-
-
Save alecchendev/3748aa5069a15cd0fc55777df105a590 to your computer and use it in GitHub Desktop.
OOP in rust article - animal enum 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Animal { | |
Dog, | |
Cat = 0, | |
Pig { cooked: bool }, | |
Cow(String), | |
Goat(Goat), | |
} | |
struct Goat { | |
age: u32, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment