aboutsummaryrefslogtreecommitdiff
path: root/src/output/sorting.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/output/sorting.rs')
-rw-r--r--src/output/sorting.rs17
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()));
}
}