From: Geoffrey Allott Date: Sat, 27 May 2023 21:11:09 +0000 (+0100) Subject: apply rustfmt fixes X-Git-Url: https://git.pointlesshacks.com/?a=commitdiff_plain;h=7521f217d628326c73cd847378d03bbe681e615e;p=pokerwave.git apply rustfmt fixes --- diff --git a/src/game/filter.rs b/src/game/filter.rs index 17002b4..05a7fe1 100644 --- a/src/game/filter.rs +++ b/src/game/filter.rs @@ -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 { mod tests { use super::*; - use serde::Deserialize; use serde::de::value::{Error, I64Deserializer}; + use serde::Deserialize; fn now() -> Timestamp { Timestamp::deserialize(I64Deserializer::::new(1685204312000)).unwrap()