summaryrefslogtreecommitdiffstats
path: root/src/context.rs
diff options
context:
space:
mode:
authorDavid Knaack <davidkna@users.noreply.github.com>2021-06-21 20:13:10 +0200
committerGitHub <noreply@github.com>2021-06-21 14:13:10 -0400
commita78c6692d90d4f52aa5863a962ef67b60b19ae53 (patch)
tree8bddb90ec7ef7bfd220ca18b686202947cc78342 /src/context.rs
parent09b12a52dd915d1391e593589f10f718a12e0f8d (diff)
fix(clippy): fix additional clippy lints in tests (#2813)
Diffstat (limited to 'src/context.rs')
-rw-r--r--src/context.rs68
1 files changed, 28 insertions, 40 deletions
diff --git a/src/context.rs b/src/context.rs
index 8fd0f03d8..451ce53c0 100644
--- a/src/context.rs
+++ b/src/context.rs
@@ -512,58 +512,46 @@ mod tests {
let empty = testdir(&[])?;
let empty_dc = DirContents::from_path(empty.path())?;
- assert_eq!(
- ScanDir {
- dir_contents: &empty_dc,
- files: &["package.json"],
- extensions: &["js"],
- folders: &["node_modules"],
- }
- .is_match(),
- false
- );
+ assert!(!ScanDir {
+ dir_contents: &empty_dc,
+ files: &["package.json"],
+ extensions: &["js"],
+ folders: &["node_modules"],
+ }
+ .is_match());
empty.close()?;
let rust = testdir(&["README.md", "Cargo.toml", "src/main.rs"])?;
let rust_dc = DirContents::from_path(rust.path())?;
- assert_eq!(
- ScanDir {
- dir_contents: &rust_dc,
- files: &["package.json"],
- extensions: &["js"],
- folders: &["node_modules"],
- }
- .is_match(),
- false
- );
+ assert!(!ScanDir {
+ dir_contents: &rust_dc,
+ files: &["package.json"],
+ extensions: &["js"],
+ folders: &["node_modules"],
+ }
+ .is_match());
rust.close()?;
let java = testdir(&["README.md", "src/com/test/Main.java", "pom.xml"])?;
let java_dc = DirContents::from_path(java.path())?;
- assert_eq!(
- ScanDir {
- dir_contents: &java_dc,
- files: &["package.json"],
- extensions: &["js"],
- folders: &["node_modules"],
- }
- .is_match(),
- false
- );
+ assert!(!ScanDir {
+ dir_contents: &java_dc,
+ files: &["package.json"],
+ extensions: &["js"],
+ folders: &["node_modules"],
+ }
+ .is_match());
java.close()?;
let node = testdir(&["README.md", "node_modules/lodash/main.js", "package.json"])?;
let node_dc = DirContents::from_path(node.path())?;
- assert_eq!(
- ScanDir {
- dir_contents: &node_dc,
- files: &["package.json"],
- extensions: &["js"],
- folders: &["node_modules"],
- }
- .is_match(),
- true
- );
+ assert!(ScanDir {
+ dir_contents: &node_dc,
+ files: &["package.json"],
+ extensions: &["js"],
+ folders: &["node_modules"],
+ }
+ .is_match());
node.close()?;
Ok(())