From fe3fac5e2b51b71f2f3b80ca55229d9b0a70b44f Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Sat, 18 Apr 2020 15:28:51 +0100 Subject: [PATCH] handle old room format --- src/room.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/room.rs b/src/room.rs index f8a0ad1..4383dc5 100644 --- a/src/room.rs +++ b/src/room.rs @@ -84,7 +84,11 @@ impl From for Room { let mut tiles: Vec = Vec::new(); for line in lines.into_iter() { - let line: Vec<&str> = line.split(",").collect(); + let line: Vec<&str> = if line.contains(",") { + line.split(",").collect() + } else { // old room format + line.split("").collect() + }; for tile_id in line { tiles.push(tile_id.to_string());