From a3501ac4946ccef3fc4cd16ee1a3b11cb6aee952 Mon Sep 17 00:00:00 2001 From: epi Date: Mon, 11 Sep 2023 08:02:35 -0400 Subject: [PATCH] clippy --- src/config/container.rs | 2 +- src/scan_manager/mod.rs | 2 +- src/statistics/tests.rs | 2 +- src/utils.rs | 2 +- tests/test_scanner.rs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/config/container.rs b/src/config/container.rs index 5a6668b..9ec13bc 100644 --- a/src/config/container.rs +++ b/src/config/container.rs @@ -1030,7 +1030,7 @@ impl Configuration { /// Given a configuration file's location and an instance of `Configuration`, read in /// the config file if found and update the current settings with the settings found therein - fn parse_and_merge_config(config_file: PathBuf, mut config: &mut Self) -> Result<()> { + fn parse_and_merge_config(config_file: PathBuf, config: &mut Self) -> Result<()> { if config_file.exists() { // save off a string version of the path before it goes out of scope let conf_str = config_file.to_str().unwrap_or("").to_string(); diff --git a/src/scan_manager/mod.rs b/src/scan_manager/mod.rs index 04177da..15ead06 100644 --- a/src/scan_manager/mod.rs +++ b/src/scan_manager/mod.rs @@ -8,7 +8,7 @@ mod state; #[cfg(test)] mod tests; -pub(self) use menu::Menu; +use menu::Menu; pub use menu::{MenuCmd, MenuCmdResult}; pub use order::ScanOrder; pub use response_container::FeroxResponses; diff --git a/src/statistics/tests.rs b/src/statistics/tests.rs index 882a395..4942a97 100644 --- a/src/statistics/tests.rs +++ b/src/statistics/tests.rs @@ -55,7 +55,7 @@ fn save_writes_stats_object_to_disk() { stats.add_status_code(StatusCode::OK); stats.add_status_code(StatusCode::OK); let outfile = NamedTempFile::new().unwrap(); - if stats.save(174.33, outfile.path().to_str().unwrap()).is_ok() {} + assert!(stats.save(174.33, outfile.path().to_str().unwrap()).is_ok()); assert!(stats.as_json().unwrap().contains("statistics")); assert!(stats.as_json().unwrap().contains("11")); // requests made diff --git a/src/utils.rs b/src/utils.rs index 9429bf5..82c4d4f 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -648,7 +648,7 @@ pub fn parse_url_with_raw_path(url: &str) -> Result { // each of the following is a string that we can expect url::Url::parse to // transform. The variety is to ensure we cover most common path traversal // encodings - let transformation_detectors = vec![ + let transformation_detectors = [ // ascii "..", // single url encoded diff --git a/tests/test_scanner.rs b/tests/test_scanner.rs index 626838c..b72fd45 100644 --- a/tests/test_scanner.rs +++ b/tests/test_scanner.rs @@ -693,7 +693,7 @@ fn collect_backups_makes_appropriate_requests() { let srv = MockServer::start(); let (tmp_dir, file) = setup_tmp_directory(&["LICENSE.txt".to_string()], "wordlist").unwrap(); - let valid_paths = vec![ + let valid_paths = [ "/LICENSE.txt", "/LICENSE.txt~", "/LICENSE.txt.bak",