mirror of
https://github.com/epi052/feroxbuster.git
synced 2026-06-02 14:01:13 -03:00
removed unnecessary async
This commit is contained in:
@@ -202,7 +202,7 @@ impl Menu {
|
||||
}
|
||||
|
||||
/// get input from the user and translate it to a `MenuCmd`
|
||||
pub(super) async fn get_command_input_from_user(&self, line: &str) -> Option<MenuCmd> {
|
||||
pub(super) fn get_command_input_from_user(&self, line: &str) -> Option<MenuCmd> {
|
||||
let line = line.trim(); // normalize input if there are leading spaces
|
||||
|
||||
match line.chars().next().unwrap_or('_').to_ascii_lowercase() {
|
||||
|
||||
@@ -381,7 +381,7 @@ impl FeroxScans {
|
||||
self.menu.print_footer();
|
||||
|
||||
let menu_cmd = if let Ok(line) = self.menu.term.read_line() {
|
||||
self.menu.get_command_input_from_user(&line).await
|
||||
self.menu.get_command_input_from_user(&line)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
@@ -625,7 +625,7 @@ async fn menu_get_command_input_from_user_returns_cancel() {
|
||||
format!("{} {}\n", cmd, idx)
|
||||
};
|
||||
|
||||
let result = menu.get_command_input_from_user(&full_cmd).await.unwrap();
|
||||
let result = menu.get_command_input_from_user(&full_cmd).unwrap();
|
||||
|
||||
assert!(matches!(result, MenuCmd::Cancel(_, _)));
|
||||
|
||||
@@ -650,14 +650,14 @@ async fn menu_get_command_input_from_user_returns_add() {
|
||||
let full_cmd = format!("{} {}\n", cmd, test_url);
|
||||
|
||||
if cmd != "None" {
|
||||
let result = menu.get_command_input_from_user(&full_cmd).await.unwrap();
|
||||
let result = menu.get_command_input_from_user(&full_cmd).unwrap();
|
||||
assert!(matches!(result, MenuCmd::Add(_)));
|
||||
|
||||
if let MenuCmd::Add(url) = result {
|
||||
assert_eq!(url, test_url);
|
||||
}
|
||||
} else {
|
||||
assert!(menu.get_command_input_from_user(&full_cmd).await.is_none());
|
||||
assert!(menu.get_command_input_from_user(&full_cmd).is_none());
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user