From 58ffb92e527221e183e365ccda32acd23867ab46 Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Tue, 23 Jun 2020 20:35:12 +0100 Subject: [PATCH] more inlining --- src/game.rs | 4 ++++ 1 file changed, 4 insertions(+) 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;