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:
David Tolnay 2022-04-29 15:47:57 -07:00
parent c6bd81bbf3
commit 6e2297fde0
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 1 additions and 2 deletions

View File

@ -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`.

View File

@ -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,