From 9a7922781cc3d216703e8ab065b13e10bb0c3079 Mon Sep 17 00:00:00 2001 From: DastInDark <2350416+hitenkoku@users.noreply.github.com> Date: Sat, 27 Aug 2022 19:08:42 +0900 Subject: [PATCH] changed output format top 5 detect count by level by date #675 --- src/afterfact.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/afterfact.rs b/src/afterfact.rs index 7f64902b..9ab1babd 100644 --- a/src/afterfact.rs +++ b/src/afterfact.rs @@ -583,12 +583,13 @@ fn _print_detection_summary_by_date( /// 各レベル毎で最も高い検知数を出した日付を出力する fn _print_detection_summary_by_computer( detect_counts_by_computer: HashMap>, - color_map: &HashMap, + color_map: &HashMap, ) { let buf_wtr = BufferWriter::stdout(ColorChoice::Always); let mut wtr = buf_wtr.buffer(); wtr.set_color(ColorSpec::new().set_fg(None)).ok(); + writeln!(wtr, "Top 5 computers with most unique detections:").ok(); for level in LEVEL_ABBR.values() { // output_levelsはlevelsからundefinedを除外した配列であり、各要素は必ず初期化されているのでSomeであることが保証されているのでunwrapをそのまま実施 let detections_by_computer = detect_counts_by_computer.get(level).unwrap(); @@ -621,7 +622,7 @@ fn _print_detection_summary_by_computer( .ok(); writeln!( wtr, - "Top 5 computers with most unique {} detections: {}", + "{}: {}", LEVEL_FULL.get(level.as_str()).unwrap(), &result_str )