We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7636658 commit 2dcaac7Copy full SHA for 2dcaac7
code/examples/demo_enum/Cargo.toml
@@ -0,0 +1,9 @@
1
+[package]
2
+name = "demo_enum"
3
+version = "0.1.0"
4
+authors = ["jameskk <[email protected]>"]
5
+edition = "2018"
6
+
7
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8
9
+[dependencies]
code/examples/demo_enum/src/main.rs
@@ -0,0 +1,11 @@
+fn main() {
+ enum Animal {
+ dog = 1,
+ cat = 200,
+ chicken,
+ tiger,
+ }
+ println!("tiger is: {}", Animal::tiger as isize);
+ println!("dog is: {}", Animal::dog as isize);
10
+ println!("cat is: {}", Animal::cat as isize);
11
+}
0 commit comments