about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJosh Triplett <josh@joshtriplett.org>2018-09-01 12:17:57 -0700
committerJosh Triplett <josh@joshtriplett.org>2018-09-01 12:20:16 -0700
commit0f40a12ea35d0a33cef29dc50787ed6efd74cbfd (patch)
treeb00b8cebf4db1ac93125e0fa02275b052478ad0f /src
parentcd51523715a77a30660dfb46898eb407937ec9d7 (diff)
downloadrust-0f40a12ea35d0a33cef29dc50787ed6efd74cbfd.tar.gz
rust-0f40a12ea35d0a33cef29dc50787ed6efd74cbfd.zip
tidy: Use is_empty() instead of len tests
Fixes a clippy warning, and improves readability.
Diffstat (limited to 'src')
-rw-r--r--src/tools/tidy/src/deps.rs2
-rw-r--r--src/tools/tidy/src/features.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/tidy/src/deps.rs b/src/tools/tidy/src/deps.rs
index 68a4b789857..5bff8480d59 100644
--- a/src/tools/tidy/src/deps.rs
+++ b/src/tools/tidy/src/deps.rs
@@ -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());
diff --git a/src/tools/tidy/src/features.rs b/src/tools/tidy/src/features.rs
index c95f1c7b32a..05eeae7d6b0 100644
--- a/src/tools/tidy/src/features.rs
+++ b/src/tools/tidy/src/features.rs
@@ -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());
     }