From 6e7240e2d7ca36cf5847b6096ad10f2b23ab97a6 Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Thu, 23 Apr 2020 08:57:46 +0100 Subject: [PATCH] streamline this --- src/room.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/room.rs b/src/room.rs index be201d6..dd72a70 100644 --- a/src/room.rs +++ b/src/room.rs @@ -99,12 +99,9 @@ impl From for Room { let mut tiles: Vec = Vec::new(); for line in lines.into_iter() { - let line: Vec<&str> = if line.contains(",") { - line.split(",").collect() - } else { - // old room format - line.split("").collect() - }; + let line: Vec<&str> = line + .split(if line.contains(",") {","} else {""}) // old room format? + .collect(); for tile_id in line { tiles.push(tile_id.to_string());