summaryrefslogtreecommitdiff
path: root/src/worldloader.rs
diff options
context:
space:
mode:
authortroido <troido@protonmail.com>2020-09-24 09:38:18 +0200
committertroido <troido@protonmail.com>2020-09-24 09:38:18 +0200
commit523a635dc88bc7890a0e1d3c062a8165259761d6 (patch)
tree56b0e379349250ecbf75eda6ccdb1f6f791dcbb1 /src/worldloader.rs
parentdaaf3a25e9c6cc1843b0a3aff71d4142f83dde10 (diff)
don't try to read into the json data structure all manually
Diffstat (limited to 'src/worldloader.rs')
-rw-r--r--src/worldloader.rs3
1 files changed, 1 insertions, 2 deletions
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)
}