tidy: Use is_empty() instead of len tests

Fixes a clippy warning, and improves readability.
This commit is contained in:
Josh Triplett 2018-09-01 12:17:57 -07:00
parent cd51523715
commit 0f40a12ea3
2 changed files with 2 additions and 2 deletions

View File

@ -239,7 +239,7 @@ pub fn check_whitelist(path: &Path, cargo: &Path, bad: &mut bool) {
unapproved.append(&mut bad);
}
if unapproved.len() > 0 {
if !unapproved.is_empty() {
println!("Dependencies not on the whitelist:");
for dep in unapproved {
println!("* {}", dep.id_str());

View File

@ -133,7 +133,7 @@ pub fn check(path: &Path, bad: &mut bool, quiet: bool) {
name);
}
if gate_untested.len() > 0 {
if !gate_untested.is_empty() {
tidy_error!(bad, "Found {} features without a gate test.", gate_untested.len());
}