cargo fmt

This commit is contained in:
DastInDark
2022-09-01 12:07:09 +09:00
parent 4d1ad6e1ad
commit 8486504a98
+12 -13
View File
@@ -654,11 +654,12 @@ fn _print_detection_summary_tables(
sorted_detections.sort_by(|a, b| (-a.1).cmp(&(-b.1)));
let take_cnt = if LEVEL_FULL.get(level.as_str()).unwrap_or(&"-".to_string()) == "informational" {
10
} else {
5
};
let take_cnt =
if LEVEL_FULL.get(level.as_str()).unwrap_or(&"-".to_string()) == "informational" {
10
} else {
5
};
for x in sorted_detections.iter().take(take_cnt) {
col_output.push(format!(
"{} ({})",
@@ -684,13 +685,13 @@ fn _print_detection_summary_tables(
for x in 0..output.len() / 2 {
let hlch = tb.style(TableComponent::HorizontalLines).unwrap();
let tbch = tb.style(TableComponent::TopBorder).unwrap();
tb.add_row(vec![
Cell::new(&output[2 * x][0])
.fg(col_color[2 * x].unwrap_or(comfy_table::Color::Reset)),
Cell::new(&output[2 * x][0]).fg(col_color[2 * x].unwrap_or(comfy_table::Color::Reset)),
Cell::new(&output[2 * x + 1][0])
.fg(col_color[2 * x + 1].unwrap_or(comfy_table::Color::Reset)),
]).set_style(TableComponent::MiddleIntersections, hlch)
])
.set_style(TableComponent::MiddleIntersections, hlch)
.set_style(TableComponent::TopBorderIntersections, tbch)
.set_style(TableComponent::BottomBorderIntersections, hlch);
@@ -705,14 +706,12 @@ fn _print_detection_summary_tables(
let odd_row = &output[4][1..6];
let even_row = &output[4][6..11];
tb.add_row(vec![
Cell::new(&output[4][0])
.fg(col_color[4].unwrap_or(comfy_table::Color::Reset)),
Cell::new(&output[4][0]).fg(col_color[4].unwrap_or(comfy_table::Color::Reset)),
Cell::new(""),
]);
tb.add_row(vec![
Cell::new(odd_row.join("\n")).fg(col_color[4].unwrap_or(comfy_table::Color::Reset)),
Cell::new(even_row.join("\n"))
.fg(col_color[4].unwrap_or(comfy_table::Color::Reset)),
Cell::new(even_row.join("\n")).fg(col_color[4].unwrap_or(comfy_table::Color::Reset)),
]);
println!("{tb}");
}