removed unnecessary async

This commit is contained in:
epi
2022-04-04 06:17:32 -05:00
parent 8d3cd2471b
commit fdb8774bfd
3 changed files with 5 additions and 5 deletions

View File

@@ -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() {

View File

@@ -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
};

View File

@@ -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());
};
}
}