apply rustfmt fixes
authorGeoffrey Allott <geoffrey@allott.email>
Sat, 27 May 2023 21:11:09 +0000 (22:11 +0100)
committerGeoffrey Allott <geoffrey@allott.email>
Sat, 27 May 2023 21:11:09 +0000 (22:11 +0100)
src/game/filter.rs

index 17002b4d154c0d259d1b001594515fa5ff31ec9f..05a7fe182e99bb0cbc22a7859e301a217198af63 100644 (file)
@@ -55,13 +55,8 @@ fn parse_millis(input: &str) -> IResult<&str, i64> {
     let int = || map_res(recognize(many1(one_of("0123456789"))), i64::from_str);
     let seconds = map(int(), |secs| secs * 1000);
     let minutes_seconds = map(
-        tuple((
-            int(),
-            tag(":"),
-            map_res(recognize(one_of("012345")), i64::from_str),
-            map_res(recognize(one_of("0123456789")), i64::from_str)
-        )),
-        |(mins, _, tens, secs)| (mins * 60 + tens * 10 + secs) * 1000
+        tuple((int(), tag(":"), map_res(recognize(one_of("012345")), i64::from_str), map_res(recognize(one_of("0123456789")), i64::from_str))),
+        |(mins, _, tens, secs)| (mins * 60 + tens * 10 + secs) * 1000,
     );
     let hours_minutes_seconds = map(
         tuple((
@@ -71,9 +66,9 @@ fn parse_millis(input: &str) -> IResult<&str, i64> {
             map_res(recognize(one_of("0123456789")), i64::from_str),
             tag(":"),
             map_res(recognize(one_of("012345")), i64::from_str),
-            map_res(recognize(one_of("0123456789")), i64::from_str)
+            map_res(recognize(one_of("0123456789")), i64::from_str),
         )),
-        |(hours, _, tenmins, mins, _, tens, secs)| (hours * 60 * 60 + tenmins * 10 * 60 + mins * 60 + tens * 10 + secs) * 1000
+        |(hours, _, tenmins, mins, _, tens, secs)| (hours * 60 * 60 + tenmins * 10 * 60 + mins * 60 + tens * 10 + secs) * 1000,
     );
     alt((hours_minutes_seconds, minutes_seconds, seconds))(input)
 }
@@ -154,8 +149,8 @@ pub fn parse_filter(input: &str) -> Result<ParsedFilter, String> {
 mod tests {
     use super::*;
 
-    use serde::Deserialize;
     use serde::de::value::{Error, I64Deserializer};
+    use serde::Deserialize;
 
     fn now() -> Timestamp {
         Timestamp::deserialize(I64Deserializer::<Error>::new(1685204312000)).unwrap()