streamline this
This commit is contained in:
parent
df7718cbf2
commit
6e7240e2d7
|
@ -99,12 +99,9 @@ impl From<String> for Room {
|
||||||
let mut tiles: Vec<String> = Vec::new();
|
let mut tiles: Vec<String> = Vec::new();
|
||||||
|
|
||||||
for line in lines.into_iter() {
|
for line in lines.into_iter() {
|
||||||
let line: Vec<&str> = if line.contains(",") {
|
let line: Vec<&str> = line
|
||||||
line.split(",").collect()
|
.split(if line.contains(",") {","} else {""}) // old room format?
|
||||||
} else {
|
.collect();
|
||||||
// old room format
|
|
||||||
line.split("").collect()
|
|
||||||
};
|
|
||||||
|
|
||||||
for tile_id in line {
|
for tile_id in line {
|
||||||
tiles.push(tile_id.to_string());
|
tiles.push(tile_id.to_string());
|
||||||
|
|
Loading…
Reference in New Issue