From 834d0898739fe86e47f5fa9f901b50dbcb041797 Mon Sep 17 00:00:00 2001 From: Dustin Blackman Date: Mon, 1 Jan 2024 11:09:17 -0500 Subject: [PATCH] chore: Lint --- tests/binary_test.rs | 21 +++++++++------------ tests/cli_integration_test.rs | 8 +++++--- tests/metadata_test.rs | 8 ++++---- tests/shims_test.rs | 3 ++- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/binary_test.rs b/tests/binary_test.rs index 4a0be3e..c0328da 100644 --- a/tests/binary_test.rs +++ b/tests/binary_test.rs @@ -1,5 +1,6 @@ mod install { - use cargo_run_bin::{binary::install, metadata}; + use cargo_run_bin::binary::install; + use cargo_run_bin::metadata; use cfg_if::cfg_if; #[test] @@ -7,9 +8,7 @@ mod install { let binary_packages = metadata::get_binary_packages().unwrap(); let nextest = binary_packages .iter() - .find(|&e| { - return e.package == "cargo-nextest"; - }) + .find(|&e| e.package == "cargo-nextest") .unwrap(); let cache_bin_path = install(nextest.clone()).unwrap(); @@ -162,7 +161,8 @@ mod cargo_install { } mod binstall { - use cargo_run_bin::{binary::binstall, metadata}; + use cargo_run_bin::binary::binstall; + use cargo_run_bin::metadata; #[test] fn it_builds_successfully() { @@ -210,19 +210,16 @@ mod binstall { } mod run { - use cargo_run_bin::{ - binary::{install, run}, - metadata, - }; + use cargo_run_bin::binary::install; + use cargo_run_bin::binary::run; + use cargo_run_bin::metadata; #[test] fn it_runs_help_successfully() { let binary_packages = metadata::get_binary_packages().unwrap(); let nextest = binary_packages .iter() - .find(|&e| { - return e.package == "cargo-nextest"; - }) + .find(|&e| e.package == "cargo-nextest") .unwrap(); let cache_bin_path = install(nextest.clone()).unwrap(); diff --git a/tests/cli_integration_test.rs b/tests/cli_integration_test.rs index 2281488..6a6c9e2 100644 --- a/tests/cli_integration_test.rs +++ b/tests/cli_integration_test.rs @@ -3,16 +3,17 @@ use cargo_run_bin::metadata; fn get_bin() -> String { return metadata::get_project_root() .unwrap() - .join(env!("CARGO_BIN_EXE_cargo-bin")) + .join(env!("CARGO_BIN_EXE_cargo-bin").replace(".exe", "")) .to_str() .unwrap() .to_string(); } mod direct { - use super::get_bin; use assert_cmd::Command; + use super::get_bin; + #[test] fn it_syncs_aliases_successfully() { let mut cmd = Command::cargo_bin(get_bin()).unwrap(); @@ -83,9 +84,10 @@ mod direct { } mod bin_prefix { - use super::get_bin; use assert_cmd::Command; + use super::get_bin; + #[test] fn it_syncs_aliases_successfully() { let mut cmd = Command::cargo_bin(get_bin()).unwrap(); diff --git a/tests/metadata_test.rs b/tests/metadata_test.rs index d66dafc..d20f515 100644 --- a/tests/metadata_test.rs +++ b/tests/metadata_test.rs @@ -4,9 +4,9 @@ mod get_binary_packages { #[test] fn it_returns_locked_packages() { let binary_packages = get_binary_packages().unwrap(); - let nextest = binary_packages.iter().find(|&e| { - return e.package == "cargo-nextest"; - }); + let nextest = binary_packages + .iter() + .find(|&e| e.package == "cargo-nextest"); assert!(nextest.is_some()); let res = nextest.unwrap(); @@ -19,7 +19,7 @@ mod get_binary_packages { fn it_returns_bin_target_packages() { let binary_packages = get_binary_packages().unwrap(); let android = binary_packages.iter().find(|&e| { - return e.bin_target.is_some() && e.bin_target.clone().unwrap() == "hello-world-first"; + e.bin_target.is_some() && e.bin_target.clone().unwrap() == "hello-world-first" }); assert!(android.is_some()); diff --git a/tests/shims_test.rs b/tests/shims_test.rs index 428c1dd..3157b56 100644 --- a/tests/shims_test.rs +++ b/tests/shims_test.rs @@ -1,5 +1,6 @@ mod sync_shims { - use cargo_run_bin::{metadata, shims::sync}; + use cargo_run_bin::metadata; + use cargo_run_bin::shims::sync; #[test] #[cfg(target_family = "unix")]