diff --git a/src/afterfact.rs b/src/afterfact.rs index 899b823e..bda286a1 100644 --- a/src/afterfact.rs +++ b/src/afterfact.rs @@ -427,15 +427,6 @@ fn _print_unique_results( tail_word: String, color_map: &HashMap, ) { - 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; } diff --git a/src/detections/message.rs b/src/detections/message.rs index fd2cfb8b..92bf150c 100644 --- a/src/detections/message.rs +++ b/src/detections/message.rs @@ -76,7 +76,7 @@ lazy_static! { .as_path() .display() )); - pub static ref LEVEL_ABBR: HashMap = HashMap::from([ + pub static ref LEVEL_ABBR: LinkedHashMap = LinkedHashMap::from_iter([ ("critical".to_string(), "crit".to_string()), ("high".to_string(), "high".to_string()), ("medium".to_string(), "med ".to_string()),