From 7c4f5317b04e8dfc8df9252d076a6242d8deb674 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sat, 6 Apr 2024 11:15:30 +0100 Subject: [PATCH] Remove period at the end of error messages --- src/board/chess_board/error.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/board/chess_board/error.rs b/src/board/chess_board/error.rs index bfc3bdc..5af3b25 100644 --- a/src/board/chess_board/error.rs +++ b/src/board/chess_board/error.rs @@ -30,24 +30,24 @@ pub enum ValidationError { impl std::fmt::Display for ValidationError { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let error_msg = match self { - Self::TooManyPieces => "Too many pieces.", - Self::MissingKing => "Missing king.", - Self::InvalidPawnPosition => "Pawns on the first/last rank.", + Self::TooManyPieces => "Too many pieces", + Self::MissingKing => "Missing king", + Self::InvalidPawnPosition => "Pawns on the first/last rank", Self::InvalidCastlingRights => { - "Castling rights do not match up with the state of the board." + "Castling rights do not match up with the state of the board" } Self::InvalidEnPassant => { - "En-passant target square is not empty, behind an opponent's pawn, on the correct rank." + "En-passant target square is not empty, behind an opponent's pawn, on the correct rank" } - Self::NeighbouringKings => "The two kings are next to each other.", - Self::OpponentInCheck => "The opponent is currently in check.", - Self::OverlappingPieces => "The piece-specific boards are overlapping.", - Self::OverlappingColors => "The color-specific boards are overlapping.", + Self::NeighbouringKings => "The two kings are next to each other", + Self::OpponentInCheck => "The opponent is currently in check", + Self::OverlappingPieces => "The piece-specific boards are overlapping", + Self::OverlappingColors => "The color-specific boards are overlapping", Self::ErroneousCombinedOccupancy => { - "The pre-computed combined occupancy boards does not match the other boards." + "The pre-computed combined occupancy boards does not match the other boards" } - Self::HalfMoveClockTooHigh => "Half-move clock is higher than total number of plies.", - Self::IncoherentPlieCount => "The total plie count does not match the current player.", + Self::HalfMoveClockTooHigh => "Half-move clock is higher than total number of plies", + Self::IncoherentPlieCount => "The total plie count does not match the current player", }; write!(f, "{}", error_msg) }