Skip to content

Commit 6e2297f

Browse files
committed
Resolve clippy::needless_question_mark
error: question mark operator is useless here --> src/helpers.rs:86:16 | 86 | return Ok(const_val.check_init()?); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing question mark and `Ok()`: `const_val.check_init()` | = note: `-D clippy::needless-question-mark` implied by `-D clippy::all` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark
1 parent c6bd81b commit 6e2297f

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/helpers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
8383
let cid = GlobalId { instance, promoted: None };
8484
let const_val = this.eval_to_allocation(cid)?;
8585
let const_val = this.read_scalar(&const_val.into())?;
86-
return Ok(const_val.check_init()?);
86+
const_val.check_init()
8787
}
8888

8989
/// Helper function to get a `libc` constant as a `Scalar`.

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
clippy::if_same_then_else,
2020
clippy::manual_map,
2121
clippy::needless_lifetimes,
22-
clippy::needless_question_mark,
2322
clippy::needless_return,
2423
clippy::new_without_default,
2524
clippy::op_ref,

0 commit comments

Comments
 (0)