From 02768b6d96b395491727904c3afa9a034bf8b745 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sun, 24 Jul 2022 16:43:18 +0200 Subject: [PATCH] Remove all useless 'allow(unused)' --- src/movegen/naive/bishop.rs | 1 - src/movegen/naive/king.rs | 1 - src/movegen/naive/knight.rs | 1 - src/movegen/naive/pawn.rs | 2 -- src/movegen/naive/rook.rs | 1 - src/movegen/wizardry/generation.rs | 3 --- src/movegen/wizardry/mod.rs | 2 -- 7 files changed, 11 deletions(-) diff --git a/src/movegen/naive/bishop.rs b/src/movegen/naive/bishop.rs index 9409cb8..7a2c97f 100644 --- a/src/movegen/naive/bishop.rs +++ b/src/movegen/naive/bishop.rs @@ -1,7 +1,6 @@ use crate::board::{Bitboard, Direction, Square}; /// Compute a bishop's movement given a set of blockers that cannot be moved past. -#[allow(unused)] pub fn bishop_moves(square: Square, blockers: Bitboard) -> Bitboard { Direction::iter_bishop() .map(|dir| dir.slide_board_with_blockers(square.into_bitboard(), blockers)) diff --git a/src/movegen/naive/king.rs b/src/movegen/naive/king.rs index 9080667..fdbedb7 100644 --- a/src/movegen/naive/king.rs +++ b/src/movegen/naive/king.rs @@ -1,7 +1,6 @@ use crate::board::{Bitboard, Direction, Square}; /// Compute a king's movement. No castling moves included -#[allow(unused)] pub fn king_moves(square: Square) -> Bitboard { let board = square.into_bitboard(); diff --git a/src/movegen/naive/knight.rs b/src/movegen/naive/knight.rs index 5cc4fc9..28ad7f2 100644 --- a/src/movegen/naive/knight.rs +++ b/src/movegen/naive/knight.rs @@ -1,7 +1,6 @@ use crate::board::{Bitboard, Direction, Square}; /// Compute a knight's movement. -#[allow(unused)] pub fn knight_moves(square: Square) -> Bitboard { let board = square.into_bitboard(); diff --git a/src/movegen/naive/pawn.rs b/src/movegen/naive/pawn.rs index 53551c5..bde5215 100644 --- a/src/movegen/naive/pawn.rs +++ b/src/movegen/naive/pawn.rs @@ -1,7 +1,6 @@ use crate::board::{Bitboard, Color, Direction, Rank, Square}; /// Compute a pawn's movement given its color, and a set of blockers that cannot be moved past. -#[allow(unused)] pub fn pawn_moves(color: Color, square: Square, blockers: Bitboard) -> Bitboard { if (square.rank() == Rank::First) || (square.rank() == Rank::Eighth) { return Bitboard::EMPTY; @@ -24,7 +23,6 @@ pub fn pawn_moves(color: Color, square: Square, blockers: Bitboard) -> Bitboard } /// Computes the set of squares a pawn can capture, given its color. -#[allow(unused)] pub fn pawn_captures(color: Color, square: Square) -> Bitboard { if (square.rank() == Rank::First) || (square.rank() == Rank::Eighth) { return Bitboard::EMPTY; diff --git a/src/movegen/naive/rook.rs b/src/movegen/naive/rook.rs index 2dbacd9..e61f5ec 100644 --- a/src/movegen/naive/rook.rs +++ b/src/movegen/naive/rook.rs @@ -1,7 +1,6 @@ use crate::board::{Bitboard, Direction, Square}; /// Compute a rook's movement given a set of blockers that cannot be moved past. -#[allow(unused)] pub fn rook_moves(square: Square, blockers: Bitboard) -> Bitboard { Direction::iter_rook() .map(|dir| dir.slide_board_with_blockers(square.into_bitboard(), blockers)) diff --git a/src/movegen/wizardry/generation.rs b/src/movegen/wizardry/generation.rs index c7c73dd..0322977 100644 --- a/src/movegen/wizardry/generation.rs +++ b/src/movegen/wizardry/generation.rs @@ -5,19 +5,16 @@ use super::mask::{generate_bishop_mask, generate_rook_mask}; use super::Magic; /// A trait to represent RNG for u64 values. -#[allow(unused)] // FIXME: remove when used pub(crate) trait RandGen { fn gen(&mut self) -> u64; } type MagicGenerationType = (Vec, Vec); -#[allow(unused)] // FIXME: remove when used pub fn generate_bishop_magics(rng: &mut dyn RandGen) -> MagicGenerationType { generate_magics(rng, generate_bishop_mask, bishop_moves) } -#[allow(unused)] // FIXME: remove when used pub fn generate_rook_magics(rng: &mut dyn RandGen) -> MagicGenerationType { generate_magics(rng, generate_rook_mask, rook_moves) } diff --git a/src/movegen/wizardry/mod.rs b/src/movegen/wizardry/mod.rs index 6ed82d7..83f4d69 100644 --- a/src/movegen/wizardry/mod.rs +++ b/src/movegen/wizardry/mod.rs @@ -28,13 +28,11 @@ impl Magic { /// A type encapsulating a database of [Magic] bitboard moves. #[derive(Clone, Debug)] -#[allow(unused)] // FIXME: remove when used pub(crate) struct MagicMoves { magics: Vec, moves: Vec, } -#[allow(unused)] // FIXME: remove when used impl MagicMoves { /// Initialize a new [MagicMoves] given a matching list of [Magic] and its corresponding moves /// as a [Bitboard].