Refactor some clippy-pedantic errors

This commit is contained in:
stefiosif
2024-09-06 20:30:57 +03:00
parent 6b9650a6f0
commit 2093d91dfa
12 changed files with 42 additions and 47 deletions

View File

@@ -153,7 +153,7 @@ impl Board {
}
}
pub fn set_piece(&mut self, piece: Piece) {
pub fn set_piece(&mut self, piece: &Piece) {
match piece.color {
Color::Black => self.black_pieces[piece.piece_type].bitboard |= piece.bitboard,
Color::White => self.white_pieces[piece.piece_type].bitboard |= piece.bitboard,
@@ -211,7 +211,7 @@ pub enum PieceType {
}
impl PieceType {
const fn idx(&self) -> usize {
const fn idx(self) -> usize {
match self {
Self::Pawn => 0,
Self::Knight => 1,
@@ -247,7 +247,7 @@ pub enum Color {
}
impl Color {
pub const fn opponent(&self) -> Self {
pub const fn opponent(self) -> Self {
match self {
Self::White => Self::Black,
Self::Black => Self::White,