From 57b74f50e59a3fab2d74bbb6165d48ce3e6e2049 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 13 May 2020 17:03:58 +0200 Subject: fix formatting --- src/output/aggregators.rs | 5 +---- src/output/mod.rs | 2 +- src/output/sorting.rs | 17 +++++++++++++---- 3 files changed, 15 insertions(+), 9 deletions(-) (limited to 'src/output') diff --git a/src/output/aggregators.rs b/src/output/aggregators.rs index 24adbf8..83171eb 100644 --- a/src/output/aggregators.rs +++ b/src/output/aggregators.rs @@ -8,10 +8,7 @@ //! an Aggregator must make sure that the data is protected by a mutex or similar. use super::{super::LogResult, formats::Format, sorting::Sorting}; -use std::{ - io::Write, - sync::Mutex, -}; +use std::{io::Write, sync::Mutex}; pub trait Aggregator: Sync { fn push_item(&self, item: LogResult, format: &dyn Format, stream: &mut dyn Write); diff --git a/src/output/mod.rs b/src/output/mod.rs index 18ab84b..c1cd787 100644 --- a/src/output/mod.rs +++ b/src/output/mod.rs @@ -9,7 +9,7 @@ pub mod sorting; pub use self::pipeline::Pipeline; -use self::{formats::Format, aggregators::Aggregator}; +use self::{aggregators::Aggregator, formats::Format}; /// Build an pipeline for the given command line options. pub fn build_pipeline(opt: &Opt) -> Pipeline { diff --git a/src/output/sorting.rs b/src/output/sorting.rs index 4f5cf19..32ebc6c 100644 --- a/src/output/sorting.rs +++ b/src/output/sorting.rs @@ -55,7 +55,7 @@ impl Display for Component { fn fmt(&self, f: &mut Formatter) -> fmt::Result { match self { Component::Date => write!(f, "date"), - Component::Boss=> write!(f, "boss"), + Component::Boss => write!(f, "boss"), Component::Outcome => write!(f, "outcome"), Component::ChallengeMote => write!(f, "cm"), Component::Reverse(ref inner) => write!(f, "~{}", inner), @@ -94,7 +94,10 @@ impl FromStr for Sorting { return Ok(Sorting::default()); } let parts = s.split(','); - parts.map(FromStr::from_str).collect::, _>>().map(Sorting::new) + parts + .map(FromStr::from_str) + .collect::, _>>() + .map(Sorting::new) } } @@ -134,7 +137,10 @@ mod tests { assert_eq!("foobar".parse::(), Err(InvalidComponent)); - assert_eq!("-date".parse(), Ok(Component::Reverse(Box::new(Component::Date)))); + assert_eq!( + "-date".parse(), + Ok(Component::Reverse(Box::new(Component::Date))) + ); } #[test] @@ -142,7 +148,10 @@ mod tests { use Component::*; assert_eq!("date".parse(), Ok(Sorting::new(vec![Date]))); assert_eq!("date,boss".parse(), Ok(Sorting::new(vec![Date, Boss]))); - assert_eq!("date,-boss".parse(), Ok(Sorting::new(vec![Date, Reverse(Box::new(Boss))]))); + assert_eq!( + "date,-boss".parse(), + Ok(Sorting::new(vec![Date, Reverse(Box::new(Boss))])) + ); assert_eq!("".parse(), Ok(Sorting::default())); } } -- cgit v1.2.3