From 0f3c61133cc0c7618f4b870b17c518d7f91d0df2 Mon Sep 17 00:00:00 2001 From: jake Date: Thu, 20 Feb 2020 22:57:50 -0800 Subject: [PATCH] fix Episode::from_bytes --- src/ship/room.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ship/room.rs b/src/ship/room.rs index ca53f19..d945ec8 100644 --- a/src/ship/room.rs +++ b/src/ship/room.rs @@ -8,7 +8,7 @@ pub enum RoomCreationError { } -#[derive(Debug)] +#[derive(Debug, Copy, Clone)] pub enum Episode { One, Two, @@ -20,9 +20,9 @@ impl TryFrom for Episode { fn try_from(value: u8) -> Result { match value { - 0 => Ok(Episode::One), - 1 => Ok(Episode::Two), - 2 => Ok(Episode::Four), + 1 => Ok(Episode::One), + 2 => Ok(Episode::Two), + 3 => Ok(Episode::Four), _ => Err(RoomCreationError::InvalidEpisode(value)) } } @@ -38,7 +38,7 @@ impl Into for Episode { } } -#[derive(Debug)] +#[derive(Debug, Copy, Clone)] pub enum Difficulty { Normal, Hard,