font errors

This commit is contained in:
Max Bradbury 2020-10-18 18:05:04 +01:00
parent 1bbfaceeb4
commit 66cb9bdd4d
2 changed files with 8 additions and 7 deletions

View File

@ -27,6 +27,7 @@ pub enum Error {
Dialogue, Dialogue,
Ending, Ending,
Exit, Exit,
Font,
Game { Game {
missing: NotFound, missing: NotFound,
}, },

View File

@ -19,13 +19,13 @@ impl Font {
} }
} }
pub(crate) fn to_string(&self) -> Result<String, &'static str> { pub(crate) fn to_string(&self) -> Result<String, crate::Error> {
match &self { match &self {
Font::UnicodeEuropeanSmall => Ok("unicode_european_small".to_string()), Font::UnicodeEuropeanSmall => Ok("unicode_european_small".to_string()),
Font::UnicodeEuropeanLarge => Ok("unicode_european_large".to_string()), Font::UnicodeEuropeanLarge => Ok("unicode_european_large".to_string()),
Font::UnicodeAsian => Ok("unicode_asian".to_string()), Font::UnicodeAsian => Ok("unicode_asian".to_string()),
Font::Arabic => Ok("arabic".to_string()), Font::Arabic => Ok("arabic".to_string()),
_ => Err("No string available for this Font"), _ => Err(crate::Error::Font),
} }
} }
} }