Skip to content

Commit 1b5002f

Browse files
committed
Remove unnecessary return statements
1 parent 3072cd1 commit 1b5002f

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

clippy_lints/src/implicit_saturating_sub.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -102,31 +102,22 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ImplicitSaturatingSub {
102102
// Check if the constant is zero
103103
if let LitKind::Int(0, _) = cond_lit.node {
104104
if cx.tables.expr_ty(cond_left).is_signed() {
105-
return;
106105
} else {
107106
print_lint_and_sugg(cx, &var_name, expr);
108-
}
109-
} else {
110-
return;
107+
};
111108
}
112109
},
113110
ExprKind::Path(ref cond_num_path) => {
114111
if INT_TYPES.iter().any( |int_type| match_qpath(cond_num_path, &[int_type, "MIN"])) {
115112
print_lint_and_sugg(cx, &var_name, expr);
116-
} else {
117-
return;
118-
}
113+
};
119114
},
120115
ExprKind::Call(ref func, _) => {
121116
if let ExprKind::Path(ref cond_num_path) = func.kind {
122117
if INT_TYPES.iter().any( |int_type| match_qpath(cond_num_path, &[int_type, "min_value"])) {
123118
print_lint_and_sugg(cx, &var_name, expr);
124-
} else {
125-
return;
126119
}
127-
} else {
128-
return;
129-
}
120+
};
130121
},
131122
_ => (),
132123
}

0 commit comments

Comments
 (0)