diff options
| author | troido <troido@protonmail.com> | 2020-03-03 13:36:44 +0100 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-03-03 13:36:44 +0100 |
| commit | b2157791dfcaab18ec7f8ebb958341fe325cf419 (patch) | |
| tree | f94e638573878599b0ee108a0b06fbe1c8f69ef9 /src/template.rs | |
| parent | a8d0e075613cc973b66c37510103108362fe7d3d (diff) | |
added spawners an not-saved assemblages/templates
Diffstat (limited to 'src/template.rs')
| -rw-r--r-- | src/template.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/template.rs b/src/template.rs index 5539f94..cf0fee2 100644 --- a/src/template.rs +++ b/src/template.rs @@ -53,7 +53,8 @@ impl Template { for (key, arg) in val.get("kwargs").unwrap_or(&json!({})).as_object().ok_or(aerr!("template kwargs not a json object"))? { kwargs.insert(key.to_string(), Parameter::guess_from_json(arg).ok_or(aerr!("template arg not a parameter"))?); } - Ok(Template {name, args, kwargs, save: true}) + let save = val.get("save").unwrap_or(&json!(true)).as_bool().ok_or(aerr!("save not a bool"))?; + Ok(Template {name, args, kwargs, save}) } pub fn to_json(&self) -> Value { |
