Skip to content

Commit 168e876

Browse files
committed
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
1 parent 1fa63f1 commit 168e876

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
clippy::field_reassign_with_default,
1818
clippy::from_over_into,
1919
clippy::if_same_then_else,
20-
clippy::len_zero,
2120
clippy::manual_map,
2221
clippy::mem_replace_with_default,
2322
clippy::needless_borrow,

src/shims/posix/thread.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
9999
let this = self.eval_context_mut();
100100
this.assert_target_os("linux", "prctl");
101101

102-
if args.len() < 1 {
102+
if args.is_empty() {
103103
throw_ub_format!(
104104
"incorrect number of arguments for `prctl`: got {}, expected at least 1",
105105
args.len()

0 commit comments

Comments
 (0)