fixed detection output order

This commit is contained in:
DustInDark
2022-08-03 10:12:15 +09:00
parent d60ed0e62c
commit 922869fb15
2 changed files with 2 additions and 11 deletions

View File

@@ -427,15 +427,6 @@ fn _print_unique_results(
tail_word: String,
color_map: &HashMap<String, Color>,
) {
let levels = Vec::from([
"critical",
"high",
"medium",
"low",
"informational",
"undefined",
]);
// the order in which are registered and the order of levels to be displayed are reversed
counts_by_level.reverse();
@@ -453,7 +444,7 @@ fn _print_unique_results(
)
.ok();
for (i, level_name) in levels.iter().enumerate() {
for (i, level_name) in LEVEL_ABBR.keys().enumerate() {
if "undefined" == *level_name {
continue;
}

View File

@@ -76,7 +76,7 @@ lazy_static! {
.as_path()
.display()
));
pub static ref LEVEL_ABBR: HashMap<String, String> = HashMap::from([
pub static ref LEVEL_ABBR: LinkedHashMap<String, String> = LinkedHashMap::from_iter([
("critical".to_string(), "crit".to_string()),
("high".to_string(), "high".to_string()),
("medium".to_string(), "med ".to_string()),