diff --git a/src/game.rs b/src/game.rs index f7f6785..8254756 100644 --- a/src/game.rs +++ b/src/game.rs @@ -36,6 +36,7 @@ pub enum RoomType {Room, Set} pub struct InvalidRoomType; impl RoomType { + #[inline] fn from(string: &str) -> Result { match string { "ROOM" => Ok(RoomType::Room), @@ -46,6 +47,7 @@ impl RoomType { } impl ToString for RoomType { + #[inline] fn to_string(&self) -> String { match &self { RoomType::Set => "SET", @@ -64,6 +66,7 @@ pub struct Version { pub struct InvalidVersion; impl Version { + #[inline] fn from(str: &str) -> Result { let parts: Vec<&str> = str.split(".").collect(); if parts.len() == 2 { @@ -106,6 +109,7 @@ pub struct GameHasNoAvatar; // todo no tiles? no rooms? no palettes? impl Game { + #[inline] pub fn from(string: String) -> Result { let line_endings_crlf = string.contains("\r\n"); let mut string = string;