Add 'FenError::InvalidPosition' variant
This commit is contained in:
parent
c112ddc4cd
commit
ddcef6f9c0
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue