Remove all useless 'allow(unused)'
This commit is contained in:
parent
af421a9452
commit
02768b6d96
|
@ -1,7 +1,6 @@
|
||||||
use crate::board::{Bitboard, Direction, Square};
|
use crate::board::{Bitboard, Direction, Square};
|
||||||
|
|
||||||
/// Compute a bishop's movement given a set of blockers that cannot be moved past.
|
/// 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 {
|
pub fn bishop_moves(square: Square, blockers: Bitboard) -> Bitboard {
|
||||||
Direction::iter_bishop()
|
Direction::iter_bishop()
|
||||||
.map(|dir| dir.slide_board_with_blockers(square.into_bitboard(), blockers))
|
.map(|dir| dir.slide_board_with_blockers(square.into_bitboard(), blockers))
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
use crate::board::{Bitboard, Direction, Square};
|
use crate::board::{Bitboard, Direction, Square};
|
||||||
|
|
||||||
/// Compute a king's movement. No castling moves included
|
/// Compute a king's movement. No castling moves included
|
||||||
#[allow(unused)]
|
|
||||||
pub fn king_moves(square: Square) -> Bitboard {
|
pub fn king_moves(square: Square) -> Bitboard {
|
||||||
let board = square.into_bitboard();
|
let board = square.into_bitboard();
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
use crate::board::{Bitboard, Direction, Square};
|
use crate::board::{Bitboard, Direction, Square};
|
||||||
|
|
||||||
/// Compute a knight's movement.
|
/// Compute a knight's movement.
|
||||||
#[allow(unused)]
|
|
||||||
pub fn knight_moves(square: Square) -> Bitboard {
|
pub fn knight_moves(square: Square) -> Bitboard {
|
||||||
let board = square.into_bitboard();
|
let board = square.into_bitboard();
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
use crate::board::{Bitboard, Color, Direction, Rank, Square};
|
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.
|
/// 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 {
|
pub fn pawn_moves(color: Color, square: Square, blockers: Bitboard) -> Bitboard {
|
||||||
if (square.rank() == Rank::First) || (square.rank() == Rank::Eighth) {
|
if (square.rank() == Rank::First) || (square.rank() == Rank::Eighth) {
|
||||||
return Bitboard::EMPTY;
|
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.
|
/// Computes the set of squares a pawn can capture, given its color.
|
||||||
#[allow(unused)]
|
|
||||||
pub fn pawn_captures(color: Color, square: Square) -> Bitboard {
|
pub fn pawn_captures(color: Color, square: Square) -> Bitboard {
|
||||||
if (square.rank() == Rank::First) || (square.rank() == Rank::Eighth) {
|
if (square.rank() == Rank::First) || (square.rank() == Rank::Eighth) {
|
||||||
return Bitboard::EMPTY;
|
return Bitboard::EMPTY;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
use crate::board::{Bitboard, Direction, Square};
|
use crate::board::{Bitboard, Direction, Square};
|
||||||
|
|
||||||
/// Compute a rook's movement given a set of blockers that cannot be moved past.
|
/// 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 {
|
pub fn rook_moves(square: Square, blockers: Bitboard) -> Bitboard {
|
||||||
Direction::iter_rook()
|
Direction::iter_rook()
|
||||||
.map(|dir| dir.slide_board_with_blockers(square.into_bitboard(), blockers))
|
.map(|dir| dir.slide_board_with_blockers(square.into_bitboard(), blockers))
|
||||||
|
|
|
@ -5,19 +5,16 @@ use super::mask::{generate_bishop_mask, generate_rook_mask};
|
||||||
use super::Magic;
|
use super::Magic;
|
||||||
|
|
||||||
/// A trait to represent RNG for u64 values.
|
/// A trait to represent RNG for u64 values.
|
||||||
#[allow(unused)] // FIXME: remove when used
|
|
||||||
pub(crate) trait RandGen {
|
pub(crate) trait RandGen {
|
||||||
fn gen(&mut self) -> u64;
|
fn gen(&mut self) -> u64;
|
||||||
}
|
}
|
||||||
|
|
||||||
type MagicGenerationType = (Vec<Magic>, Vec<Bitboard>);
|
type MagicGenerationType = (Vec<Magic>, Vec<Bitboard>);
|
||||||
|
|
||||||
#[allow(unused)] // FIXME: remove when used
|
|
||||||
pub fn generate_bishop_magics(rng: &mut dyn RandGen) -> MagicGenerationType {
|
pub fn generate_bishop_magics(rng: &mut dyn RandGen) -> MagicGenerationType {
|
||||||
generate_magics(rng, generate_bishop_mask, bishop_moves)
|
generate_magics(rng, generate_bishop_mask, bishop_moves)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unused)] // FIXME: remove when used
|
|
||||||
pub fn generate_rook_magics(rng: &mut dyn RandGen) -> MagicGenerationType {
|
pub fn generate_rook_magics(rng: &mut dyn RandGen) -> MagicGenerationType {
|
||||||
generate_magics(rng, generate_rook_mask, rook_moves)
|
generate_magics(rng, generate_rook_mask, rook_moves)
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,13 +28,11 @@ impl Magic {
|
||||||
|
|
||||||
/// A type encapsulating a database of [Magic] bitboard moves.
|
/// A type encapsulating a database of [Magic] bitboard moves.
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
#[allow(unused)] // FIXME: remove when used
|
|
||||||
pub(crate) struct MagicMoves {
|
pub(crate) struct MagicMoves {
|
||||||
magics: Vec<Magic>,
|
magics: Vec<Magic>,
|
||||||
moves: Vec<Bitboard>,
|
moves: Vec<Bitboard>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unused)] // FIXME: remove when used
|
|
||||||
impl MagicMoves {
|
impl MagicMoves {
|
||||||
/// Initialize a new [MagicMoves] given a matching list of [Magic] and its corresponding moves
|
/// Initialize a new [MagicMoves] given a matching list of [Magic] and its corresponding moves
|
||||||
/// as a [Bitboard].
|
/// as a [Bitboard].
|
||||||
|
|
Loading…
Reference in a new issue