Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ manual_let_else = { level = "allow", priority = 1 }
manual_string_new = { level = "allow", priority = 1 }
many_single_char_names = { level = "allow", priority = 1 }
match_on_vec_items = { level = "allow", priority = 1 }
match_same_arms = { level = "allow", priority = 1 }
match_wildcard_for_single_variants = { level = "allow", priority = 1 }
missing_errors_doc = { level = "allow", priority = 1 }
missing_fields_in_debug = { level = "allow", priority = 1 }
Expand Down
3 changes: 1 addition & 2 deletions src/geometry/closest_points.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ fn closest_points_aux(
(dr, (r1, r2))
}
}
(Some((a, b)), None) => (a.euclidean_distance(&b), (a, b)),
(None, Some((a, b))) => (a.euclidean_distance(&b), (a, b)),
(Some((a, b)), None) | (None, Some((a, b))) => (a.euclidean_distance(&b), (a, b)),
(None, None) => unreachable!(),
};

Expand Down
23 changes: 8 additions & 15 deletions src/graph/depth_first_search_tic_tac_toe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,10 @@ fn append_playaction(
(Players::Blank, _, _) => panic!("Unreachable state."),

//Winning scores
(Players::PlayerX, Players::PlayerX, Players::PlayerX) => {
(Players::PlayerX, Players::PlayerX, Players::PlayerX)
| (Players::PlayerO, Players::PlayerO, Players::PlayerO) => {
play_actions.positions.push(appendee.position);
}
(Players::PlayerX, Players::PlayerX, _) => {}
(Players::PlayerO, Players::PlayerO, Players::PlayerO) => {
play_actions.positions.push(appendee.position);
}
(Players::PlayerO, Players::PlayerO, _) => {}

//Non-winning to Winning scores
(Players::PlayerX, _, Players::PlayerX) => {
Expand All @@ -302,21 +298,18 @@ fn append_playaction(
}

//Losing to Neutral scores
(Players::PlayerX, Players::PlayerO, Players::Blank) => {
play_actions.side = Players::Blank;
play_actions.positions.clear();
play_actions.positions.push(appendee.position);
}

(Players::PlayerO, Players::PlayerX, Players::Blank) => {
(Players::PlayerX, Players::PlayerO, Players::Blank)
| (Players::PlayerO, Players::PlayerX, Players::Blank) => {
play_actions.side = Players::Blank;
play_actions.positions.clear();
play_actions.positions.push(appendee.position);
}

//Ignoring lower scored plays
(Players::PlayerX, Players::Blank, Players::PlayerO) => {}
(Players::PlayerO, Players::Blank, Players::PlayerX) => {}
(Players::PlayerX, Players::PlayerX, _)
| (Players::PlayerO, Players::PlayerO, _)
| (Players::PlayerX, Players::Blank, Players::PlayerO)
| (Players::PlayerO, Players::Blank, Players::PlayerX) => {}

//No change hence append only
(_, _, _) => {
Expand Down
3 changes: 1 addition & 2 deletions src/math/miller_rabin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ pub fn miller_rabin(number: u64, bases: &[u64]) -> u64 {
0 => {
panic!("0 is invalid input for Miller-Rabin. 0 is not prime by definition, but has no witness");
}
2 => return 0,
3 => return 0,
2 | 3 => return 0,
_ => return number,
}
}
Expand Down