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
This commit is contained in:
parent
c6bd81bbf3
commit
6e2297fde0
@ -83,7 +83,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
||||
let cid = GlobalId { instance, promoted: None };
|
||||
let const_val = this.eval_to_allocation(cid)?;
|
||||
let const_val = this.read_scalar(&const_val.into())?;
|
||||
return Ok(const_val.check_init()?);
|
||||
const_val.check_init()
|
||||
}
|
||||
|
||||
/// Helper function to get a `libc` constant as a `Scalar`.
|
||||
|
@ -19,7 +19,6 @@
|
||||
clippy::if_same_then_else,
|
||||
clippy::manual_map,
|
||||
clippy::needless_lifetimes,
|
||||
clippy::needless_question_mark,
|
||||
clippy::needless_return,
|
||||
clippy::new_without_default,
|
||||
clippy::op_ref,
|
||||
|
Loading…
x
Reference in New Issue
Block a user