Skip to content

Commit 75ed0c9

Browse files
author
Evan Typanski
committed
Prefer .ok()? over .unwrap()
1 parent 6e1df47 commit 75ed0c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/manual_rem_euclid.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ fn check_for_positive_int_constant<'a>(cx: &'a LateContext<'_>, expr: &'a Expr<'
107107

108108
if int_const > FullInt::S(0) {
109109
let val = match int_const {
110-
FullInt::S(s) => s.try_into().unwrap(),
110+
FullInt::S(s) => s.try_into().ok()?,
111111
FullInt::U(u) => u,
112112
};
113113
Some((val, other_op))

0 commit comments

Comments
 (0)