From 23ede8563ab3e9403f8d23b91833df0d31d4001f Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Wed, 16 Aug 2023 23:22:25 +0700 Subject: [PATCH] clippy: tests: Fix clippy warnings. --- tests/criterion_tests.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/criterion_tests.rs b/tests/criterion_tests.rs index 7b608214b..6a009fa5f 100644 --- a/tests/criterion_tests.rs +++ b/tests/criterion_tests.rs @@ -52,7 +52,7 @@ impl Default for Counter { } } -fn verify_file(dir: &PathBuf, path: &str) -> PathBuf { +fn verify_file(dir: &Path, path: &str) -> PathBuf { let full_path = dir.join(path); assert!( full_path.is_file(), @@ -64,36 +64,36 @@ fn verify_file(dir: &PathBuf, path: &str) -> PathBuf { full_path } -fn verify_json(dir: &PathBuf, path: &str) { +fn verify_json(dir: &Path, path: &str) { let full_path = verify_file(dir, path); let f = File::open(full_path).unwrap(); serde_json::from_reader::(f).unwrap(); } #[cfg(feature = "html_reports")] -fn verify_svg(dir: &PathBuf, path: &str) { +fn verify_svg(dir: &Path, path: &str) { verify_file(dir, path); } #[cfg(feature = "html_reports")] -fn verify_html(dir: &PathBuf, path: &str) { +fn verify_html(dir: &Path, path: &str) { verify_file(dir, path); } -fn verify_stats(dir: &PathBuf, baseline: &str) { +fn verify_stats(dir: &Path, baseline: &str) { verify_json(dir, &format!("{}/estimates.json", baseline)); verify_json(dir, &format!("{}/sample.json", baseline)); verify_json(dir, &format!("{}/tukey.json", baseline)); verify_json(dir, &format!("{}/benchmark.json", baseline)); #[cfg(feature = "csv_output")] - verify_file(&dir, &format!("{}/raw.csv", baseline)); + verify_file(dir, &format!("{}/raw.csv", baseline)); } -fn verify_not_exists(dir: &PathBuf, path: &str) { +fn verify_not_exists(dir: &Path, path: &str) { assert!(!dir.join(path).exists()); } -fn latest_modified(dir: &PathBuf) -> SystemTime { +fn latest_modified(dir: &Path) -> SystemTime { let mut newest_update: Option = None; for entry in WalkDir::new(dir) { let entry = entry.unwrap();