From 3ad74c90b7bee6f113fc40a89b0df245c332073e Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Thu, 24 Apr 2025 13:05:31 -0400 Subject: [PATCH] elo: fix display --- src/elo.rs | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/elo.rs b/src/elo.rs index 7104fa3..5fa2b8a 100644 --- a/src/elo.rs +++ b/src/elo.rs @@ -5,7 +5,7 @@ use crate::{ logic::{ChildrenEvalMethod, FutureMoveConfig}, repr::{Board, Piece, Winner}, }; -use indicatif::{ParallelProgressIterator, ProgressBar, ProgressDrawTarget, ProgressStyle}; +use indicatif::{ParallelProgressIterator, ProgressStyle}; use rand::seq::SliceRandom; use rayon::iter::{IntoParallelIterator, ParallelIterator}; use skillratings::{ @@ -189,7 +189,6 @@ impl PlayerArena { // Spawn parallel processing in a dedicated thread let processing_thread = { let sender = sender.clone(); - let term = term.clone(); std::thread::spawn(move || { rayon::ThreadPoolBuilder::new() @@ -203,22 +202,12 @@ impl PlayerArena { created_pairs .into_par_iter() - .progress_with({ - let a = ProgressBar::new(num as u64).with_style( - ProgressStyle::with_template( - "[{elapsed_precise}] {pos:>7}/{len:7} ETA: {eta}", - ) - .expect("invalid ProgressStyle"), - ); - a.set_draw_target(ProgressDrawTarget::term(term, 5)); - a - }) - .progress_with_style( + .progress_with_style({ ProgressStyle::with_template( "[{elapsed_precise}] {pos:>7}/{len:7} ETA: {eta}", ) - .expect("invalid ProgressStyle"), - ) + .expect("invalid ProgressStyle") + }) .map(|((i, j), (p1, p2))| (i, j, Self::play_two_inner(p1, p2))) .for_each(|(i, j, o)| { sender.send((i, j, o)).expect("Failed to send result");