aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel <kingdread@gmx.de>2020-05-13 17:03:58 +0200
committerDaniel <kingdread@gmx.de>2020-05-13 17:03:58 +0200
commit57b74f50e59a3fab2d74bbb6165d48ce3e6e2049 (patch)
tree0bd8b9b5c3e087805217fa52097cc8b41f4ce863 /src
parent5272800a7e397f6fcc7933b474d182fec4d18b08 (diff)
downloadraidgrep-57b74f50e59a3fab2d74bbb6165d48ce3e6e2049.tar.gz
raidgrep-57b74f50e59a3fab2d74bbb6165d48ce3e6e2049.tar.bz2
raidgrep-57b74f50e59a3fab2d74bbb6165d48ce3e6e2049.zip
fix formatting
Diffstat (limited to 'src')
-rw-r--r--src/output/aggregators.rs5
-rw-r--r--src/output/mod.rs2
-rw-r--r--src/output/sorting.rs17
3 files changed, 15 insertions, 9 deletions
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::<Result<Vec<Component>, _>>().map(Sorting::new)
+ parts
+ .map(FromStr::from_str)
+ .collect::<Result<Vec<Component>, _>>()
+ .map(Sorting::new)
}
}
@@ -134,7 +137,10 @@ mod tests {
assert_eq!("foobar".parse::<Component>(), 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()));
}
}