Repository: dtolnay/cxx (language: rust)

Issue:
Fix clippy warnings



Discussion / hints:

Fix patch:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f8f66dc76..26b2722ac 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -92,4 +92,4 @@ jobs:
     steps:
       - uses: actions/checkout@v2
       - uses: dtolnay/rust-toolchain@clippy
-      - run: cargo clippy --workspace -- -Dclippy::all
+      - run: cargo clippy --workspace --tests -- -Dclippy::all


Test patch:
diff --git a/gen/lib/tests/test.rs b/gen/lib/tests/test.rs
index be2e60f12..73a25f33f 100644
--- a/gen/lib/tests/test.rs
+++ b/gen/lib/tests/test.rs
@@ -16,8 +16,8 @@ fn test_positive() {
     };
     let opt = Opt::default();
     let code = cxx_gen::generate_header_and_cc(rs, &opt).unwrap();
-    assert!(code.header.len() > 0);
-    assert!(code.implementation.len() > 0);
+    assert!(!code.header.is_empty());
+    assert!(!code.implementation.is_empty());
 }
 
 #[test]
diff --git a/tests/cxx_gen.rs b/tests/cxx_gen.rs
index 1818af4cc..06d7bc7be 100644
--- a/tests/cxx_gen.rs
+++ b/tests/cxx_gen.rs
@@ -1,3 +1,5 @@
+#![allow(clippy::field_reassign_with_default)]
+
 use cxx_gen::{generate_header_and_cc, Opt};
 use std::str;
 
diff --git a/tests/test.rs b/tests/test.rs
index 2c6f062f2..e3f9fcebb 100644
--- a/tests/test.rs
+++ b/tests/test.rs
@@ -1,3 +1,5 @@
+#![allow(clippy::assertions_on_constants, clippy::float_cmp, clippy::unit_cmp)]
+
 use cxx_test_suite::extra::ffi2;
 use cxx_test_suite::ffi;
 use std::cell::Cell;