diff --git a/src/position.rs b/src/position.rs index 717378d..c24e190 100644 --- a/src/position.rs +++ b/src/position.rs @@ -10,13 +10,13 @@ impl Position { pub(crate) fn from(string: String) -> Result { // e.g. "2,5" let xy: Vec<&str> = string.split(',').collect(); - let x = xy[0].parse().unwrap(); + let x = xy[0].parse().expect("Bad x coordinate supplied for Position"); if xy.len() < 2 { panic!("Bad position : {}", string); } - let y = xy[1].parse().unwrap(); + let y = xy[1].parse().expect("Bad y coordinate supplied for Position"); Ok(Position { x, y }) }