diff options
Diffstat (limited to 'src/worldloader.rs')
| -rw-r--r-- | src/worldloader.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/worldloader.rs b/src/worldloader.rs index d8a7c0f..2d7ae69 100644 --- a/src/worldloader.rs +++ b/src/worldloader.rs @@ -1,5 +1,5 @@ -use std::path::PathBuf; +use std::path::{PathBuf}; use std::fs; use serde_json; use serde_json::Value; @@ -22,9 +22,8 @@ impl WorldLoader { } pub fn load_room(&self, id: RoomId) -> Result<RoomTemplate> { - let mut path = self.directory.clone(); let fname = id.to_string() + ".json"; - path.push(fname); + let path = self.directory.join(fname); let text = fs::read_to_string(path)?; let json: Value = serde_json::from_str(&text)?; let template = RoomTemplate::from_json(&json)?; |
