cargo fmt

This commit is contained in:
DastInDark
2022-08-08 23:33:56 +09:00
parent 7eca067fd5
commit 20293d9b61

View File

@@ -14,7 +14,7 @@ use lazy_static::lazy_static;
use linked_hash_map::LinkedHashMap;
use hashbrown::{HashMap, HashSet};
use num_format::{ToFormattedString, Locale};
use num_format::{Locale, ToFormattedString};
use std::cmp::min;
use std::error::Error;
@@ -335,7 +335,10 @@ fn emit_csv<W: std::io::Write>(
write_color_buffer(
&disp_wtr,
get_writable_color(None),
&format!("Total events: {}", all_record_cnt.to_formatted_string(&Locale::en)),
&format!(
"Total events: {}",
all_record_cnt.to_formatted_string(&Locale::en)
),
true,
)
.ok();
@@ -344,7 +347,8 @@ fn emit_csv<W: std::io::Write>(
get_writable_color(None),
&format!(
"Data reduction: {} events ({:.2}%)",
reducted_record_cnt.to_formatted_string(&Locale::en), reducted_percent
reducted_record_cnt.to_formatted_string(&Locale::en),
reducted_percent
),
true,
)
@@ -441,7 +445,10 @@ fn _print_unique_results(
"{} {}: {}",
head_word,
tail_word,
counts_by_level.iter().sum::<u128>().to_formatted_string(&Locale::en),
counts_by_level
.iter()
.sum::<u128>()
.to_formatted_string(&Locale::en),
),
true,
)
@@ -453,7 +460,10 @@ fn _print_unique_results(
}
let output_raw_str = format!(
"{} {} {}: {}",
head_word, level_name, tail_word, counts_by_level[i].to_formatted_string(&Locale::en)
head_word,
level_name,
tail_word,
counts_by_level[i].to_formatted_string(&Locale::en)
);
write_color_buffer(
&BufferWriter::stdout(ColorChoice::Always),
@@ -528,7 +538,11 @@ fn _print_detection_summary_by_computer(
sorted_detections.sort_by(|a, b| (-a.1).cmp(&(-b.1)));
for x in sorted_detections.iter().take(5) {
result_vec.push(format!("{} ({})", x.0, x.1.to_formatted_string(&Locale::en)));
result_vec.push(format!(
"{} ({})",
x.0,
x.1.to_formatted_string(&Locale::en)
));
}
let result_str = if result_vec.is_empty() {
"n/a".to_string()