From 8a562b9f8cd37fe23bc61974ee2124d77bbd9885 Mon Sep 17 00:00:00 2001 From: Justin Worthe Date: Sat, 11 Aug 2018 17:10:28 +0200 Subject: Clippy-suggested edits --- src/strategy/monte_carlo.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/strategy/monte_carlo.rs') diff --git a/src/strategy/monte_carlo.rs b/src/strategy/monte_carlo.rs index 0844402..57eaaff 100644 --- a/src/strategy/monte_carlo.rs +++ b/src/strategy/monte_carlo.rs @@ -16,7 +16,7 @@ use rayon::prelude::*; #[cfg(feature = "energy-cutoff")] pub const ENERGY_PRODUCTION_CUTOFF: u16 = 30; #[cfg(feature = "energy-cutoff")] pub const ENERGY_STORAGE_CUTOFF: u16 = 45; -pub fn choose_move(state: &BitwiseGameState, start_time: &PreciseTime, max_time: Duration) -> Command { +pub fn choose_move(state: &BitwiseGameState, start_time: PreciseTime, max_time: Duration) -> Command { let mut command_scores = CommandScore::init_command_scores(state); let command = simulate_options_to_timeout(&mut command_scores, state, start_time, max_time); @@ -27,7 +27,7 @@ pub fn choose_move(state: &BitwiseGameState, start_time: &PreciseTime, max_time: } #[cfg(not(feature = "discard-poor-performers"))] -fn simulate_options_to_timeout(command_scores: &'a mut Vec, settings: &GameSettings, state: &BitwiseGameState, start_time: &PreciseTime, max_time: Duration) -> Option<&'a CommandScore> { +fn simulate_options_to_timeout(command_scores: &'a mut Vec, settings: &GameSettings, state: &BitwiseGameState, start_time: PreciseTime, max_time: Duration) -> Option<&'a CommandScore> { loop { simulate_all_options_once(command_scores, settings, state); if start_time.to(PreciseTime::now()) > max_time { @@ -45,7 +45,7 @@ fn simulate_options_to_timeout(command_scores: &'a mut Vec, settin } #[cfg(feature = "discard-poor-performers")] -fn simulate_options_to_timeout<'a>(command_scores: &'a mut Vec, state: &BitwiseGameState, start_time: &PreciseTime, max_time: Duration) -> Option<&'a CommandScore> { +fn simulate_options_to_timeout<'a>(command_scores: &'a mut Vec, state: &BitwiseGameState, start_time: PreciseTime, max_time: Duration) -> Option<&'a CommandScore> { use std::cmp; let min_options = cmp::min(command_scores.len(), 5); -- cgit v1.2.3