diff --git a/Cargo.toml b/Cargo.toml index e0f7bcd8e32..f6afbf3d3ab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 } diff --git a/src/geometry/closest_points.rs b/src/geometry/closest_points.rs index def9207649b..e92dc562501 100644 --- a/src/geometry/closest_points.rs +++ b/src/geometry/closest_points.rs @@ -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!(), }; diff --git a/src/graph/depth_first_search_tic_tac_toe.rs b/src/graph/depth_first_search_tic_tac_toe.rs index 43b62e81eeb..788991c3823 100644 --- a/src/graph/depth_first_search_tic_tac_toe.rs +++ b/src/graph/depth_first_search_tic_tac_toe.rs @@ -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) => { @@ -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 (_, _, _) => { diff --git a/src/math/miller_rabin.rs b/src/math/miller_rabin.rs index fff93c5994c..dbeeac5acbd 100644 --- a/src/math/miller_rabin.rs +++ b/src/math/miller_rabin.rs @@ -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, } }