From 4b8730d6e0ee24ed07efa4f0c240ea6f2a2bf0fa Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Thu, 27 Jul 2023 10:44:26 +0200 Subject: [PATCH] Fix pedantic clippy lints --- tests/count.rs | 14 +++++++------- tests/util/mod.rs | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/count.rs b/tests/count.rs index 709949d..bb56b85 100644 --- a/tests/count.rs +++ b/tests/count.rs @@ -5,14 +5,14 @@ use tempfile::TempDir; #[test] fn no_repos() { let repos = TempDir::new().unwrap(); - assert_eq!(0, count_repositories(&repos).unwrap()) + assert_eq!(0, count_repositories(&repos).unwrap()); } #[test] fn no_repos_for_provider() { let repos = TempDir::new().unwrap(); let _provider = TempDir::new_in(&repos).unwrap(); - assert_eq!(0, count_repositories(&repos).unwrap()) + assert_eq!(0, count_repositories(&repos).unwrap()); } #[test] @@ -20,7 +20,7 @@ fn no_repos_for_owner() { let repos = TempDir::new().unwrap(); let provider = TempDir::new_in(&repos).unwrap(); let _owner = TempDir::new_in(&provider).unwrap(); - assert_eq!(0, count_repositories(&repos).unwrap()) + assert_eq!(0, count_repositories(&repos).unwrap()); } #[test] @@ -29,7 +29,7 @@ fn one_repo_for_owner() { let provider = TempDir::new_in(&repos).unwrap(); let owner = TempDir::new_in(&provider).unwrap(); let _repo = TempDir::new_in(&owner).unwrap(); - assert_eq!(1, count_repositories(&repos).unwrap()) + assert_eq!(1, count_repositories(&repos).unwrap()); } #[test] @@ -39,7 +39,7 @@ fn two_repos_for_owner() { let owner = TempDir::new_in(&provider).unwrap(); let _repo1 = TempDir::new_in(&owner).unwrap(); let _repo2 = TempDir::new_in(&owner).unwrap(); - assert_eq!(2, count_repositories(&repos).unwrap()) + assert_eq!(2, count_repositories(&repos).unwrap()); } #[test] @@ -51,7 +51,7 @@ fn two_repos_for_two_providers() { let provider2 = TempDir::new_in(&repos).unwrap(); let owner2 = TempDir::new_in(&provider2).unwrap(); let _repo2 = TempDir::new_in(&owner2).unwrap(); - assert_eq!(2, count_repositories(&repos).unwrap()) + assert_eq!(2, count_repositories(&repos).unwrap()); } #[test] @@ -62,5 +62,5 @@ fn two_subdirs_in_one_repo() { let repo = TempDir::new_in(&owner).unwrap(); let _subdir1 = TempDir::new_in(&repo).unwrap(); let _subdir2 = TempDir::new_in(&repo).unwrap(); - assert_eq!(1, count_repositories(&repos).unwrap()) + assert_eq!(1, count_repositories(&repos).unwrap()); } diff --git a/tests/util/mod.rs b/tests/util/mod.rs index 371268b..60607a2 100644 --- a/tests/util/mod.rs +++ b/tests/util/mod.rs @@ -25,14 +25,14 @@ pub async fn spawn_app() -> TestApp { let listener = TcpListener::bind("127.0.0.1:0").expect("Failed to bind random port"); let port = listener.local_addr().unwrap().port(); - let address = format!("http://127.0.0.1:{}", port); + let address = format!("http://127.0.0.1:{port}"); - let _repo_dir = tempdir().expect("Cannot create repo_dir"); - let _cache_dir = tempdir().expect("Cannot create cache_dir"); + let repo_dir = tempdir().expect("Cannot create repo_dir"); + let cache_dir = tempdir().expect("Cannot create cache_dir"); let mut settings = Settings::load().expect("Failed to read configuration."); - settings.repodir = _repo_dir.path().to_path_buf(); - settings.cachedir = _cache_dir.path().to_path_buf(); + settings.repodir = repo_dir.path().to_path_buf(); + settings.cachedir = cache_dir.path().to_path_buf(); let server = hoc::run(listener, settings) .await @@ -44,7 +44,7 @@ pub async fn spawn_app() -> TestApp { TestApp { address, - _repo_dir, - _cache_dir, + _repo_dir: repo_dir, + _cache_dir: cache_dir, } }