summaryrefslogtreecommitdiff
path: root/src/template.rs
diff options
context:
space:
mode:
authortroido <troido@protonmail.com>2020-05-21 15:26:12 +0200
committertroido <troido@protonmail.com>2020-06-05 22:27:54 +0200
commit1899b27b791734a6b72e28cfb1420536c6035ee4 (patch)
treecbb908f05c1daa1c9fb996d474a34f0b6f4aba76 /src/template.rs
parentf47034bdf86e7ddc831ecb8f50689b9b07a0f6ca (diff)
added exchanger as seperate component/system; refactored other interactions; parameter parsing returns result instead of option
Diffstat (limited to 'src/template.rs')
-rw-r--r--src/template.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/template.rs b/src/template.rs
index 0ac03cd..7422465 100644
--- a/src/template.rs
+++ b/src/template.rs
@@ -89,11 +89,11 @@ impl Template {
let name = EntityType(val.get("type").ok_or(perr!("template doesn't have 'type'"))?.as_str().ok_or(perr!("template type not a string"))?.to_string());
let mut args = Vec::new();
for arg in val.get("args").unwrap_or(&json!([])).as_array().ok_or(perr!("template args not an array"))? {
- args.push(Parameter::guess_from_json(arg).ok_or(perr!("template arg {:?} not a parameter", arg))?);
+ args.push(Parameter::guess_from_json(arg)?);
}
let mut kwargs = HashMap::new();
for (key, arg) in val.get("kwargs").unwrap_or(&json!({})).as_object().ok_or(perr!("template kwargs not a json object"))? {
- kwargs.insert(key.to_string(), Parameter::guess_from_json(arg).ok_or(perr!("template kwarg {}: {:?} not a parameter", key, arg))?);
+ kwargs.insert(key.to_string(), Parameter::guess_from_json(arg)?);
}
let save =
if let Some(saveval) = val.get("save") {