From 523a635dc88bc7890a0e1d3c062a8165259761d6 Mon Sep 17 00:00:00 2001 From: troido Date: Thu, 24 Sep 2020 09:38:18 +0200 Subject: don't try to read into the json data structure all manually --- src/item.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/item.rs') diff --git a/src/item.rs b/src/item.rs index 88fd583..0abf35d 100644 --- a/src/item.rs +++ b/src/item.rs @@ -52,8 +52,8 @@ impl ItemAction { "eat" => Eat(arg.as_i64()?), "build" => Build( Template::from_json(arg.get(0)?).ok()?, - arg.get(1)?.as_array()?.iter().map(|v| Flag::from_str(v.as_str()?)).collect::>>()?, - arg.get(2)?.as_array()?.iter().map(|v| Flag::from_str(v.as_str()?)).collect::>>()? + arg.get(1)?.as_array()?.iter().map(|v| Flag::from_str(v.as_str()?).ok()).collect::>>()?, + arg.get(2)?.as_array()?.iter().map(|v| Flag::from_str(v.as_str()?).ok()).collect::>>()? ), "none" => None, "equip" => Equip(Equippable::from_json(arg)?), -- cgit