Skip to content

Commit 0f40a12

Browse files
committed
tidy: Use is_empty() instead of len tests
Fixes a clippy warning, and improves readability.
1 parent cd51523 commit 0f40a12

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/tools/tidy/src/deps.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ pub fn check_whitelist(path: &Path, cargo: &Path, bad: &mut bool) {
239239
unapproved.append(&mut bad);
240240
}
241241

242-
if unapproved.len() > 0 {
242+
if !unapproved.is_empty() {
243243
println!("Dependencies not on the whitelist:");
244244
for dep in unapproved {
245245
println!("* {}", dep.id_str());

src/tools/tidy/src/features.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ pub fn check(path: &Path, bad: &mut bool, quiet: bool) {
133133
name);
134134
}
135135

136-
if gate_untested.len() > 0 {
136+
if !gate_untested.is_empty() {
137137
tidy_error!(bad, "Found {} features without a gate test.", gate_untested.len());
138138
}
139139

0 commit comments

Comments
 (0)