Refactor some clippy-pedantic errors
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user