Skip to content

Commit b72cb48

Browse files
committed
use ?
1 parent 93a509f commit b72cb48

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

clippy_lints/src/operators/modulo_arithmetic.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ struct OperandInfo {
5656
}
5757

5858
fn analyze_operand(operand: &Expr<'_>, cx: &LateContext<'_>, expr: &Expr<'_>) -> Option<OperandInfo> {
59-
match ConstEvalCtxt::new(cx).eval(operand) {
60-
Some(Constant::Int(v)) => match *cx.typeck_results().expr_ty(expr).kind() {
59+
match ConstEvalCtxt::new(cx).eval(operand)? {
60+
Constant::Int(v) => match *cx.typeck_results().expr_ty(expr).kind() {
6161
ty::Int(ity) => {
6262
let value = sext(cx.tcx, v, ity);
6363
Some(OperandInfo {
@@ -74,8 +74,8 @@ fn analyze_operand(operand: &Expr<'_>, cx: &LateContext<'_>, expr: &Expr<'_>) ->
7474
_ => None,
7575
},
7676
// FIXME(f16_f128): add when casting is available on all platforms
77-
Some(Constant::F32(f)) => Some(floating_point_operand_info(&f)),
78-
Some(Constant::F64(f)) => Some(floating_point_operand_info(&f)),
77+
Constant::F32(f) => Some(floating_point_operand_info(&f)),
78+
Constant::F64(f) => Some(floating_point_operand_info(&f)),
7979
_ => None,
8080
}
8181
}

0 commit comments

Comments
 (0)