mirror of
https://github.com/epi052/feroxbuster.git
synced 2026-04-19 06:31:13 -03:00
clippy/fmt
This commit is contained in:
@@ -190,7 +190,11 @@ impl Menu {
|
||||
if value.contains('-') {
|
||||
// range of two values, needs further processing
|
||||
|
||||
let range: Vec<usize> = value.split('-').map(|s| self.str_to_usize(s)).collect();
|
||||
let range: Vec<usize> = value
|
||||
.split('-')
|
||||
.map(|s| self.str_to_usize(s))
|
||||
.filter(|m| *m != 0)
|
||||
.collect();
|
||||
|
||||
if range.len() != 2 {
|
||||
// expecting [1, 4] or similar, if a 0 was used, we'd be left with a vec of size 1
|
||||
@@ -206,6 +210,10 @@ impl Menu {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if value.is_empty() {
|
||||
continue;
|
||||
}
|
||||
|
||||
let value = self.str_to_usize(value);
|
||||
|
||||
if !nums.contains(&value) {
|
||||
|
||||
@@ -39,6 +39,7 @@ pub struct FeroxScan {
|
||||
pub scan_type: ScanType,
|
||||
|
||||
/// The order in which the scan was received
|
||||
#[allow(dead_code)] // not entirely sure this isn't used somewhere
|
||||
pub(crate) scan_order: ScanOrder,
|
||||
|
||||
/// Number of requests to populate the progress bar with
|
||||
|
||||
@@ -668,11 +668,7 @@ fn menu_get_command_input_from_user_returns_cancel() {
|
||||
assert!(matches!(result, MenuCmd::Cancel(_, _)));
|
||||
|
||||
if let MenuCmd::Cancel(canx_list, ret_force) = result {
|
||||
if idx == 0 {
|
||||
assert!(canx_list.is_empty());
|
||||
} else {
|
||||
assert_eq!(canx_list, vec![idx]);
|
||||
}
|
||||
assert_eq!(canx_list, vec![idx]);
|
||||
assert_eq!(force, ret_force);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user