Resolve clippy::len_zero

error: length comparison to one
       --> src/shims/posix/thread.rs:102:12
        |
    102 |         if args.len() < 1 {
        |            ^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `args.is_empty()`
        |
        = note: `-D clippy::len-zero` implied by `-D clippy::all`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
This commit is contained in:
David Tolnay 2022-04-29 15:33:45 -07:00
parent 1fa63f1e9b
commit 168e87682f
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 1 additions and 2 deletions

View File

@ -17,7 +17,6 @@
clippy::field_reassign_with_default,
clippy::from_over_into,
clippy::if_same_then_else,
clippy::len_zero,
clippy::manual_map,
clippy::mem_replace_with_default,
clippy::needless_borrow,

View File

@ -99,7 +99,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
let this = self.eval_context_mut();
this.assert_target_os("linux", "prctl");
if args.len() < 1 {
if args.is_empty() {
throw_ub_format!(
"incorrect number of arguments for `prctl`: got {}, expected at least 1",
args.len()