error handling for position

This commit is contained in:
2020-04-18 16:12:06 +01:00
parent 78b2319d4f
commit c954e56ea9
5 changed files with 12 additions and 10 deletions

View File

@@ -60,7 +60,7 @@ impl From<String> for Sprite {
panic!("Bad room/position for sprite: {}", string);
}
position = Some(Position::from(room_position[1].to_string()));
position = Some(Position::from(room_position[1].to_string()).unwrap());
} else if last_line.starts_with("COL") {
colour_id = Some(last_line.replace("COL ", "").parse().unwrap());
} else {