diff options
author | Daniel <kingdread@gmx.de> | 2020-05-13 17:03:58 +0200 |
---|---|---|
committer | Daniel <kingdread@gmx.de> | 2020-05-13 17:03:58 +0200 |
commit | 57b74f50e59a3fab2d74bbb6165d48ce3e6e2049 (patch) | |
tree | 0bd8b9b5c3e087805217fa52097cc8b41f4ce863 /src/output/sorting.rs | |
parent | 5272800a7e397f6fcc7933b474d182fec4d18b08 (diff) | |
download | raidgrep-57b74f50e59a3fab2d74bbb6165d48ce3e6e2049.tar.gz raidgrep-57b74f50e59a3fab2d74bbb6165d48ce3e6e2049.tar.bz2 raidgrep-57b74f50e59a3fab2d74bbb6165d48ce3e6e2049.zip |
fix formatting
Diffstat (limited to 'src/output/sorting.rs')
-rw-r--r-- | src/output/sorting.rs | 17 |
1 files changed, 13 insertions, 4 deletions
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())); } } |