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

@@ -58,7 +58,7 @@ impl From<String> for Exit {
// e.g. "EXT 6,4 0 10,12 FX fade_w"
let room_position_effect: Vec<&str> = string.split_whitespace().collect();
let room_id = from_base36(room_position_effect[0]);
let position = Position::from(room_position_effect[1].to_string());
let position = Position::from(room_position_effect[1].to_string()).unwrap();
let effect = if room_position_effect.len() == 4 {
Transition::from(room_position_effect[3])