streamline this

This commit is contained in:
Max Bradbury 2020-04-23 08:57:46 +01:00
parent df7718cbf2
commit 6e7240e2d7
1 changed files with 3 additions and 6 deletions

View File

@ -99,12 +99,9 @@ impl From<String> for Room {
let mut tiles: Vec<String> = 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());