diff options
| author | troido <troido@protonmail.com> | 2020-04-01 13:27:42 +0200 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-04-01 13:27:42 +0200 |
| commit | 1ceb4c6f23287bca98f0c3946d5678dce5d0457c (patch) | |
| tree | c354643711d0a6066b149206a29d2182b281f50f /src/template.rs | |
| parent | 69ac6eb6153b016c39bbe55c85f15e3478032182 (diff) | |
better time handling for growing plants
Diffstat (limited to 'src/template.rs')
| -rw-r--r-- | src/template.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/template.rs b/src/template.rs index cf0fee2..496d08e 100644 --- a/src/template.rs +++ b/src/template.rs @@ -42,7 +42,7 @@ impl Template { pub fn from_json(val: &Value) -> Result<Template> { if val.is_string(){ - return Ok(Self::empty(val.as_str().ok_or(aerr!("json string is not a string?"))?)); + return Ok(Self::empty(val.as_str().unwrap())); } let name = EntityType(val.get("type").ok_or(aerr!("template doesn't have 'type'"))?.as_str().ok_or(aerr!("template type not a string"))?.to_string()); let mut args = Vec::new(); |
