We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
redundant_else
1 parent a11736a commit d4c3126Copy full SHA for d4c3126
Cargo.toml
@@ -59,7 +59,6 @@ must_use_candidate = { level = "allow", priority = 1 }
59
needless_pass_by_value = { level = "allow", priority = 1 }
60
range_plus_one = { level = "allow", priority = 1 }
61
redundant_closure_for_method_calls = { level = "allow", priority = 1 }
62
-redundant_else = { level = "allow", priority = 1 }
63
return_self_not_must_use = { level = "allow", priority = 1 }
64
semicolon_if_nothing_returned = { level = "allow", priority = 1 }
65
should_panic_without_expect = { level = "allow", priority = 1 }
src/data_structures/b_tree.rs
@@ -152,9 +152,8 @@ where
152
Err(index) => {
153
if current_node.is_leaf() {
154
return false;
155
- } else {
156
- current_node = ¤t_node.children[index];
157
}
+ current_node = ¤t_node.children[index];
158
159
160
src/general/kmeans.rs
@@ -88,9 +88,8 @@ macro_rules! impl_kmeans {
88
{
89
// We need to use `return` to break out of the `loop`
90
return clustering;
91
92
- clustering = new_clustering;
93
+ clustering = new_clustering;
94
95
96
src/graph/depth_first_search_tic_tac_toe.rs
@@ -95,14 +95,13 @@ fn main() {
if result.is_none() {
println!("Not a valid empty coordinate.");
97
continue;
98
- }else{
99
- board[move_pos.y as usize][move_pos.x as usize] = Players::PlayerX;
+ }
+ board[move_pos.y as usize][move_pos.x as usize] = Players::PlayerX;
100
101
- if win_check(Players::PlayerX, &board) {
102
- display_board(&board);
103
- println!("Player X Wins!");
104
- return;
105
- }
+ if win_check(Players::PlayerX, &board) {
+ display_board(&board);
+ println!("Player X Wins!");
+ return;
106
107
108
//Find the best game plays from the current board state
src/searching/saddleback_search.rs
@@ -22,9 +22,8 @@ pub fn saddleback_search(matrix: &[Vec<i32>], element: i32) -> (usize, usize) {
22
// If the target element is smaller, move to the previous column (leftwards)
23
if right_index == 0 {
24
break; // If we reach the left-most column, exit the loop
25
26
- right_index -= 1;
27
+ right_index -= 1;
28
29
30
src/searching/ternary_search_min_max_recursive.rs
@@ -16,9 +16,8 @@ pub fn ternary_search_max_rec(
16
return ternary_search_max_rec(f, mid1, end, absolute_precision);
17
} else if r1 > r2 {
18
return ternary_search_max_rec(f, start, mid2, absolute_precision);
19
20
- return ternary_search_max_rec(f, mid1, mid2, absolute_precision);
21
+ return ternary_search_max_rec(f, mid1, mid2, absolute_precision);
f(start)
@@ -41,9 +40,8 @@ pub fn ternary_search_min_rec(
41
40
return ternary_search_min_rec(f, start, mid2, absolute_precision);
42
43
return ternary_search_min_rec(f, mid1, end, absolute_precision);
44
45
- return ternary_search_min_rec(f, mid1, mid2, absolute_precision);
46
+ return ternary_search_min_rec(f, mid1, mid2, absolute_precision);
47
48
49
src/string/aho_corasick.rs
@@ -51,9 +51,8 @@ impl AhoCorasick {
51
child.lengths.extend(node.borrow().lengths.clone());
52
child.suffix = Rc::downgrade(node);
53
break;
54
55
- suffix = suffix.unwrap().borrow().suffix.upgrade();
56
+ suffix = suffix.unwrap().borrow().suffix.upgrade();
57
58
src/string/jaro_winkler_distance.rs
@@ -43,12 +43,11 @@ pub fn jaro_winkler_distance(str1: &str, str2: &str) -> f64 {
let jaro: f64 = {
if match_count == 0 {
return 0.0;
- (1_f64 / 3_f64)
- * (match_count as f64 / str1.len() as f64
- + match_count as f64 / str2.len() as f64
50
- + (match_count - transpositions) as f64 / match_count as f64)
+ (1_f64 / 3_f64)
+ * (match_count as f64 / str1.len() as f64
+ + match_count as f64 / str2.len() as f64
+ + (match_count - transpositions) as f64 / match_count as f64)
};
let mut prefix_len = 0.0;
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments