aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzriel Hoh <azriel91@gmail.com>2018-10-10 09:16:03 +1300
committerAzriel Hoh <azriel91@gmail.com>2018-11-10 11:06:38 +1300
commitb6559e9e8dbbe2d9dacc1b5960541315a9765816 (patch)
treee079fe5c36f17054595b76305426673b9ca4922c
parenteff2ed3b51fecf4e6799690c09ce35daa6e51280 (diff)
downloadmilf-rs-b6559e9e8dbbe2d9dacc1b5960541315a9765816.tar.gz
milf-rs-b6559e9e8dbbe2d9dacc1b5960541315a9765816.zip
Added `NewType` variant to example.
-rw-r--r--examples/enum_external.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/enum_external.rs b/examples/enum_external.rs
index 1feff77..095dca5 100644
--- a/examples/enum_external.rs
+++ b/examples/enum_external.rs
@@ -14,6 +14,7 @@ struct Config {
// tuple: MyEnum,
#[serde(rename = "struct")]
structv: MyEnum,
+ newtype: MyEnum,
my_enum: Vec<MyEnum>,
}
@@ -21,6 +22,7 @@ struct Config {
enum MyEnum {
Plain,
Tuple(i64, bool),
+ NewType(String),
Struct { value: i64 },
}
@@ -29,9 +31,11 @@ fn main() {
plain = "Plain"
# tuple = { 0 = 123, 1 = true }
struct = { Struct = { value = 123 } }
+ newtype = { NewType = "value" }
my_enum = [
{ Plain = {} },
# { Tuple = { 0 = 123, 1 = true } },
+ { NewType = "value" },
{ Struct = { value = 123 } }
]"#;