error for parsing game

This commit is contained in:
Max Bradbury 2020-06-23 13:05:53 +01:00
parent 4d33a0a284
commit 716554e88b
1 changed files with 4 additions and 1 deletions

View File

@ -102,8 +102,11 @@ pub struct Game {
pub(crate) line_endings_crlf: bool, // otherwise lf (unix/mac) pub(crate) line_endings_crlf: bool, // otherwise lf (unix/mac)
} }
#[derive(Debug)]
pub struct GameHasNoAvatar;
impl Game { impl Game {
pub fn from(string: String) -> Result<Game, &'static dyn Error> { pub fn from(string: String) -> Result<Game, GameHasNoAvatar> {
let line_endings_crlf = string.contains("\r\n"); let line_endings_crlf = string.contains("\r\n");
let mut string = string; let mut string = string;
if line_endings_crlf { if line_endings_crlf {