diff options
| author | Austin Hellyer <[email protected]> | 2016-11-08 11:00:51 -0800 |
|---|---|---|
| committer | Austin Hellyer <[email protected]> | 2016-11-08 11:00:51 -0800 |
| commit | f50da4fda6b8180e820ab7965a3d3846256139e6 (patch) | |
| tree | 3ebde4ed7e2a618a94e059dcd99186fcf86de85e | |
| parent | Make all Embed fields except for 'kind' optional (diff) | |
| download | serenity-f50da4fda6b8180e820ab7965a3d3846256139e6.tar.xz serenity-f50da4fda6b8180e820ab7965a3d3846256139e6.zip | |
Fix build script for optional defaulted u64s
| -rw-r--r-- | build.rs | 5 | ||||
| -rw-r--r-- | definitions/structs/embed.yml | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -353,6 +353,11 @@ impl {0} {{ custom, default) }, + ("u64", false, false, Some(default), None, Some(from), None) => { + format!(r#"try!(opt(&mut map, "{}", |v| Ok(req!(v.as_u64())))).unwrap_or({})"#, + from, + default.parse::<u64>().unwrap()) + }, ("u64", false, false, None, None, Some(from), None) => { format!(r#"req!(try!(remove(&mut map, "{}")).as_u64())"#, from) diff --git a/definitions/structs/embed.yml b/definitions/structs/embed.yml index ed832b8..308562d 100644 --- a/definitions/structs/embed.yml +++ b/definitions/structs/embed.yml @@ -9,7 +9,7 @@ fields: - name: colour description: The color code of the embed. from: color - optional: true + default: "0" type: u64 - name: description description: The description of the embed. This is the long string of text. |