Skip to content

Commit

Permalink
Clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bcollazo committed Oct 26, 2024
1 parent d7c589a commit adc0be4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion catanatron_rust/src/game.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ mod tests {

assert_eq!(state.generate_playable_actions().len(), 54);
play_tick(&players, &mut state);
assert_eq!(state.is_initial_build_phase(), true);
assert!(state.is_initial_build_phase());
assert_eq!(state.generate_playable_actions().len(), 3);
}
}
6 changes: 3 additions & 3 deletions catanatron_rust/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ mod tests {
fn test_initial_build_phase() {
let state = setup_state();

assert_eq!(state.is_initial_build_phase(), true);
assert_eq!(state.is_moving_robber(), false);
assert_eq!(state.is_discarding(), false);
assert!(state.is_initial_build_phase());
assert!(!state.is_moving_robber());
assert!(!state.is_discarding());
}
}
4 changes: 2 additions & 2 deletions catanatron_rust/src/state/mutations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl State {
let component = HashSet::from([node_id]);
self.connected_components
.entry(color)
.or_insert(Vec::new())
.or_default()
.push(component);
} else {
todo!();
Expand All @@ -36,7 +36,7 @@ impl State {

let is_initial_build_phase = self.is_initial_build_phase();
if !is_initial_build_phase {
freqdeck_sub(&mut self.get_mut_player_hand(color), SETTLEMENT_COST);
freqdeck_sub(self.get_mut_player_hand(color), SETTLEMENT_COST);
freqdeck_add(&mut self.vector[BANK_RESOURCE_SLICE], SETTLEMENT_COST);
}
}
Expand Down
2 changes: 1 addition & 1 deletion catanatron_rust/src/state_vector.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{decks::starting_dev_listdeck, map_instance::MapInstance};
use crate::decks::starting_dev_listdeck;
use rand::seq::SliceRandom;

use crate::enums::COLORS;
Expand Down

1 comment on commit adc0be4

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Performance Alert

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.30.

Benchmark suite Current: adc0be4 Previous: 76442c7 Ratio
tests/integration_tests/test_speed.py::test_alphabeta_speed 0.8956903685585919 iter/sec (stddev: 1.0101094453446422) 1.547154901885194 iter/sec (stddev: 0.8523989465417423) 1.73
tests/integration_tests/test_speed.py::test_same_turn_alphabeta_speed 1.3311948376937193 iter/sec (stddev: 0.7215329899472849) 2.1853453861699226 iter/sec (stddev: 0.4958501291431887) 1.64

This comment was automatically generated by workflow.

Please sign in to comment.