diff --git a/src/elo.rs b/src/elo.rs index 3714db7..24be500 100644 --- a/src/elo.rs +++ b/src/elo.rs @@ -7,9 +7,7 @@ use crate::{ logic::{ChildrenEvalMethod, FutureMoveConfig}, repr::{Board, Piece, Winner}, }; -use indicatif::{ - ParallelProgressIterator, ProgressBar, ProgressDrawTarget, ProgressStyle, TermLike, -}; +use indicatif::{ParallelProgressIterator, ProgressBar, ProgressDrawTarget, ProgressStyle}; use rand::seq::SliceRandom; use rayon::iter::{IntoParallelIterator, ParallelIterator}; use skillratings::{ @@ -17,6 +15,7 @@ use skillratings::{ Outcomes, Rating, }; +#[allow(dead_code)] pub fn run() { const FMV_BASE: FutureMoveConfig = FutureMoveConfig { max_depth: 20, diff --git a/src/logic/future_moves.rs b/src/logic/future_moves.rs index e6aafde..1a03df3 100644 --- a/src/logic/future_moves.rs +++ b/src/logic/future_moves.rs @@ -74,6 +74,7 @@ impl std::fmt::Display for FutureMoveConfig { } #[derive(Debug, Clone, Copy)] +#[allow(dead_code)] pub enum ChildrenEvalMethod { /// Best (by far) strat compared to Max or Min Average, @@ -168,6 +169,7 @@ impl FutureMoves { } } + #[allow(dead_code)] fn remove(&mut self, index: usize) { if let Some(parent) = self.arena[index].parent { self.arena[parent].children.retain(|&j| j != index); @@ -410,6 +412,7 @@ impl FutureMoves { /// Checks the consistancy of the Arena (parents and children) /// returns a vector of errors ([`String`]) + #[allow(dead_code)] pub fn check_arena(&self) -> Vec { let mut errors = vec![]; for idx in 0..self.arena.len() { diff --git a/src/repr/board.rs b/src/repr/board.rs index 8b552b9..442df6a 100644 --- a/src/repr/board.rs +++ b/src/repr/board.rs @@ -1,7 +1,11 @@ use super::{bitboard::BitBoard, piece::Piece, CoordAxis, CoordPair}; use arrayvec::ArrayVec; use rand::seq::IteratorRandom; -use std::{cmp::Ordering, fmt}; +use std::{ + cmp::Ordering, + fmt, + ops::{BitAndAssign, BitOrAssign}, +}; /// Map of all points on the board against some type T /// Used to index like so: example[i][j] @@ -274,8 +278,8 @@ impl Board { } fn apply_flip_mask(&mut self, color: Piece, flip_mask: BitBoard) { - *get_board!(mut self, color) |= flip_mask; - *get_board!(mut self, color.flip()) &= !flip_mask; + get_board!(mut self, color).bitor_assign(flip_mask); + get_board!(mut self, color.flip()).bitand_assign(!flip_mask); } /// Propegate piece captures originating from (i, j) diff --git a/src/repr/coords.rs b/src/repr/coords.rs index 5b06c21..6581e79 100644 --- a/src/repr/coords.rs +++ b/src/repr/coords.rs @@ -20,6 +20,7 @@ impl CoordPair { Self(row * Board::BOARD_SIZE + col) } + #[allow(clippy::wrong_self_convention)] fn into_indexes(&self) -> (CoordAxis, CoordAxis) { self.0.div_mod_floor(&Board::BOARD_SIZE) }