Skip to content

Commit 2d23c7f

Browse files
eduardosmAmanieu
authored andcommitted
Use is_empty instead of comparing len to zero
1 parent 264ff89 commit 2d23c7f

File tree

1 file changed

+4
-4
lines changed
  • stdarch/crates/stdarch-gen/src

1 file changed

+4
-4
lines changed

stdarch/crates/stdarch-gen/src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1672,7 +1672,7 @@ fn gen_load_test(
16721672
for (a, b, _, n, e) in current_tests {
16731673
let a: Vec<String> = a.iter().take(type_len + 1).cloned().collect();
16741674
let e: Vec<String> = e.iter().take(type_len).cloned().collect();
1675-
let has_b = b.len() > 0;
1675+
let has_b = !b.is_empty();
16761676
let has_n = n.is_some();
16771677
let mut input = String::from("[");
16781678
for i in 0..type_len + 1 {
@@ -2714,7 +2714,7 @@ fn get_call(
27142714
aarch64: bool,
27152715
) -> String {
27162716
let params: Vec<_> = in_str.split(',').map(|v| v.trim().to_string()).collect();
2717-
assert!(params.len() > 0);
2717+
assert!(!params.is_empty());
27182718
let mut fn_name = params[0].clone();
27192719
if fn_name == "a" {
27202720
return String::from("a");
@@ -3428,13 +3428,13 @@ mod test {
34283428
} else {
34293429
panic!("Bad spec: {line}")
34303430
}
3431-
if b.len() == 0 {
3431+
if b.is_empty() {
34323432
if matches!(fn_type, Fntype::Store) {
34333433
para_num = 2;
34343434
} else {
34353435
para_num = 1;
34363436
}
3437-
} else if c.len() != 0 {
3437+
} else if !c.is_empty() {
34383438
para_num = 3;
34393439
}
34403440
let current_name = current_name.clone().unwrap();

0 commit comments

Comments
 (0)