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() {
|
if !reports.is_empty() {
|
||||||
terminal.print_separator("Summary");
|
terminal.print_separator("Summary");
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::collections::HashMap;
|
|
||||||
|
|
||||||
pub type Report = HashMap<String, bool>;
|
pub type Report = Vec<(String, bool)>;
|
||||||
|
|
||||||
pub trait Reporter {
|
pub trait Reporter {
|
||||||
fn report<'a, M: Into<Cow<'a, str>>>(&self, key: M, report: &mut Report);
|
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) {
|
fn report<'a, M: Into<Cow<'a, str>>>(&self, key: M, report: &mut Report) {
|
||||||
match self {
|
match self {
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
report.insert(key.into().into_owned(), false);
|
report.push((key.into().into_owned(), false));
|
||||||
}
|
}
|
||||||
Ok(item) => {
|
Ok(item) => {
|
||||||
item.report(key, report);
|
item.report(key, report);
|
||||||
@@ -36,12 +35,12 @@ where
|
|||||||
|
|
||||||
impl Reporter for bool {
|
impl Reporter for bool {
|
||||||
fn report<'a, M: Into<Cow<'a, str>>>(&self, key: M, report: &mut Report) {
|
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 () {
|
impl Reporter for () {
|
||||||
fn report<'a, M: Into<Cow<'a, str>>>(&self, key: M, report: &mut Report) {
|
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