From 66cb9bdd4dfd49a6de608c1f48ac950e8124ce9c Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Sun, 18 Oct 2020 18:05:04 +0100 Subject: [PATCH] font errors --- src/error.rs | 1 + src/text.rs | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/error.rs b/src/error.rs index dfe8a28..1adaa8e 100644 --- a/src/error.rs +++ b/src/error.rs @@ -27,6 +27,7 @@ pub enum Error { Dialogue, Ending, Exit, + Font, Game { missing: NotFound, }, diff --git a/src/text.rs b/src/text.rs index a732573..0caeb3a 100644 --- a/src/text.rs +++ b/src/text.rs @@ -13,19 +13,19 @@ impl Font { match str { "unicode_european_small" => Font::UnicodeEuropeanSmall, "unicode_european_large" => Font::UnicodeEuropeanLarge, - "unicode_asian" => Font::UnicodeAsian, - "arabic" => Font::Arabic, - _ => Font::Custom, + "unicode_asian" => Font::UnicodeAsian, + "arabic" => Font::Arabic, + _ => Font::Custom, } } - pub(crate) fn to_string(&self) -> Result { + pub(crate) fn to_string(&self) -> Result { match &self { Font::UnicodeEuropeanSmall => Ok("unicode_european_small".to_string()), Font::UnicodeEuropeanLarge => Ok("unicode_european_large".to_string()), - Font::UnicodeAsian => Ok("unicode_asian".to_string()), - Font::Arabic => Ok("arabic".to_string()), - _ => Err("No string available for this Font"), + Font::UnicodeAsian => Ok("unicode_asian".to_string()), + Font::Arabic => Ok("arabic".to_string()), + _ => Err(crate::Error::Font), } } }