diff options
| author | Evan Typanski <evan.typanski@microfocus.com> | 2022-06-22 13:15:35 -0400 |
|---|---|---|
| committer | Evan Typanski <evan.typanski@microfocus.com> | 2022-06-22 13:15:35 -0400 |
| commit | 75ed0c9f267c8e65d3bbd45c6e10acd11e702077 (patch) | |
| tree | 674f9d08a37da108eca475d887b994e0d374bf1e | |
| parent | 6e1df4732b6fb877361b0dd3b209f194481bbe7b (diff) | |
| download | rust-75ed0c9f267c8e65d3bbd45c6e10acd11e702077.tar.gz rust-75ed0c9f267c8e65d3bbd45c6e10acd11e702077.zip | |
Prefer `.ok()?` over `.unwrap()`
| -rw-r--r-- | clippy_lints/src/manual_rem_euclid.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clippy_lints/src/manual_rem_euclid.rs b/clippy_lints/src/manual_rem_euclid.rs index cba03389a9b..d6b74b3e1ca 100644 --- a/clippy_lints/src/manual_rem_euclid.rs +++ b/clippy_lints/src/manual_rem_euclid.rs @@ -107,7 +107,7 @@ fn check_for_positive_int_constant<'a>(cx: &'a LateContext<'_>, expr: &'a Expr<' if int_const > FullInt::S(0) { let val = match int_const { - FullInt::S(s) => s.try_into().unwrap(), + FullInt::S(s) => s.try_into().ok()?, FullInt::U(u) => u, }; Some((val, other_op)) |
