Add 'FenError::InvalidPosition' variant
This commit is contained in:
parent
c112ddc4cd
commit
ddcef6f9c0
|
@ -12,12 +12,15 @@ pub trait FromFen: Sized {
|
||||||
pub enum FenError {
|
pub enum FenError {
|
||||||
/// Invalid FEN input.
|
/// Invalid FEN input.
|
||||||
InvalidFen,
|
InvalidFen,
|
||||||
|
/// Invalid chess position.
|
||||||
|
InvalidPosition,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl std::fmt::Display for FenError {
|
impl std::fmt::Display for FenError {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
let error_msg = match self {
|
let error_msg = match self {
|
||||||
Self::InvalidFen => "Invalid FEN input",
|
Self::InvalidFen => "Invalid FEN input",
|
||||||
|
Self::InvalidPosition => "Invalid chess position",
|
||||||
};
|
};
|
||||||
write!(f, "{}", error_msg)
|
write!(f, "{}", error_msg)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue