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/worldloader.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/worldloader.rs') diff --git a/src/worldloader.rs b/src/worldloader.rs index 8e0622e..8934fc8 100644 --- a/src/worldloader.rs +++ b/src/worldloader.rs @@ -57,8 +57,7 @@ impl WorldLoader { let fname = id.name.splitn(2, '+').next().unwrap().to_string() + ".json"; let path = self.directory.join("maps").join(fname); let text = fs::read_to_string(path)?; - let json: Value = serde_json::from_str(&text)?; - let template = RoomTemplate::from_json(&json)?; + let template = serde_json::from_str(&text)?; Ok(template) } -- cgit