From b375893461270b14777f1f45bc7c8137e4ea8db9 Mon Sep 17 00:00:00 2001 From: epi Date: Tue, 11 Apr 2023 18:32:56 -0500 Subject: [PATCH] nitpickery --- src/heuristics.rs | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/heuristics.rs b/src/heuristics.rs index 20d5d6e..09e35f7 100644 --- a/src/heuristics.rs +++ b/src/heuristics.rs @@ -1,5 +1,5 @@ -use std::sync::Arc; use std::collections::HashMap; +use std::sync::Arc; use anyhow::{bail, Result}; use scraper::{Html, Selector}; @@ -280,19 +280,14 @@ impl HeuristicTests { // 6 is due to the array in the nested for loop below let mut responses = Vec::with_capacity(6); - let extensions = if self.handles.config.extensions.is_empty() { - vec!["".to_string()] - } else { - let mut exts: Vec = self - .handles - .config - .extensions - .iter() - .map(|ext| format!(".{}", ext)) - .collect(); - exts.push("".to_string()); - exts - }; + // no matter what, we want an empty extension for the base case + let mut extensions = vec!["".to_string()]; + + // and then we want to add any extensions that was specified + // or has since been added to the running config + for ext in &self.handles.config.extensions { + extensions.push(format!(".{}", ext)); + } // for every method, attempt to id its 404 response //