Display the summary in execution order
This commit is contained in:
@@ -221,9 +221,6 @@ fn main() -> Result<(), Error> {
|
||||
}
|
||||
}
|
||||
|
||||
let mut reports: Vec<_> = reports.into_iter().collect();
|
||||
reports.sort();
|
||||
|
||||
if !reports.is_empty() {
|
||||
terminal.print_separator("Summary");
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
use std::borrow::Cow;
|
||||
use std::collections::HashMap;
|
||||
|
||||
pub type Report = HashMap<String, bool>;
|
||||
pub type Report = Vec<(String, bool)>;
|
||||
|
||||
pub trait Reporter {
|
||||
fn report<'a, M: Into<Cow<'a, str>>>(&self, key: M, report: &mut Report);
|
||||
@@ -14,7 +13,7 @@ where
|
||||
fn report<'a, M: Into<Cow<'a, str>>>(&self, key: M, report: &mut Report) {
|
||||
match self {
|
||||
Err(_) => {
|
||||
report.insert(key.into().into_owned(), false);
|
||||
report.push((key.into().into_owned(), false));
|
||||
}
|
||||
Ok(item) => {
|
||||
item.report(key, report);
|
||||
@@ -36,12 +35,12 @@ where
|
||||
|
||||
impl Reporter for bool {
|
||||
fn report<'a, M: Into<Cow<'a, str>>>(&self, key: M, report: &mut Report) {
|
||||
report.insert(key.into().into_owned(), *self);
|
||||
report.push((key.into().into_owned(), *self));
|
||||
}
|
||||
}
|
||||
|
||||
impl Reporter for () {
|
||||
fn report<'a, M: Into<Cow<'a, str>>>(&self, key: M, report: &mut Report) {
|
||||
report.insert(key.into().into_owned(), true);
|
||||
report.push((key.into().into_owned(), true));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user