From eefa707c0794323874dacc5abee1752447863ba0 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 29 Jul 2022 19:24:47 +0200 Subject: [PATCH] Silence useless clippy warnings Those warnings are either explicitly accounted for in the code, or make the code look worse if fixed. --- src/board/castle_rights.rs | 1 + src/board/chess_board.rs | 1 + src/board/move.rs | 1 + 3 files changed, 3 insertions(+) diff --git a/src/board/castle_rights.rs b/src/board/castle_rights.rs index a48bf4d..6b0bb66 100644 --- a/src/board/castle_rights.rs +++ b/src/board/castle_rights.rs @@ -67,6 +67,7 @@ impl CastleRights { } /// Add some [CastleRights], and return the resulting [CastleRights]. + #[allow(clippy::should_implement_trait)] #[inline(always)] pub fn add(self, to_remove: CastleRights) -> Self { // SAFETY: we know the value is in-bounds diff --git a/src/board/chess_board.rs b/src/board/chess_board.rs index c10510a..3ef9707 100644 --- a/src/board/chess_board.rs +++ b/src/board/chess_board.rs @@ -190,6 +190,7 @@ impl ChessBoard { fn is_valid(&self) -> bool { // Don't overlap pieces. for piece in Piece::iter() { + #[allow(clippy::collapsible_if)] for other in Piece::iter() { if piece != other { if !(self.piece_occupancy(piece) & self.piece_occupancy(other)).is_empty() { diff --git a/src/board/move.rs b/src/board/move.rs index 0372a47..60672f8 100644 --- a/src/board/move.rs +++ b/src/board/move.rs @@ -84,6 +84,7 @@ mod shift { impl Move { /// Construct a new move. + #[allow(clippy::too_many_arguments)] #[inline(always)] fn new( piece: Piece,