From ddcef6f9c0f847a7b0ad7b620e9d36ccc2e9266b Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Thu, 28 Jul 2022 21:17:12 +0200 Subject: [PATCH] Add 'FenError::InvalidPosition' variant --- src/fen.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/fen.rs b/src/fen.rs index 8273392..d8af180 100644 --- a/src/fen.rs +++ b/src/fen.rs @@ -12,12 +12,15 @@ pub trait FromFen: Sized { pub enum FenError { /// Invalid FEN input. InvalidFen, + /// Invalid chess position. + InvalidPosition, } impl std::fmt::Display for FenError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let error_msg = match self { Self::InvalidFen => "Invalid FEN input", + Self::InvalidPosition => "Invalid chess position", }; write!(f, "{}", error_msg) }