@@ -106,16 +106,16 @@ fn seconds(input: &mut &str) -> ModalResult<Relative> {
106106fn displacement ( input : & mut & str ) -> ModalResult < Relative > {
107107 ( opt ( ordinal) , s ( alpha1) , ago)
108108 . verify_map ( |( n, unit, ago) : ( Option < i32 > , & str , bool ) | {
109- let multipler = n. unwrap_or ( 1 ) * if ago { -1 } else { 1 } ;
109+ let multiplier = n. unwrap_or ( 1 ) * if ago { -1 } else { 1 } ;
110110 Some ( match unit. strip_suffix ( 's' ) . unwrap_or ( unit) {
111- "year" => Relative :: Years ( multipler ) ,
112- "month" => Relative :: Months ( multipler ) ,
113- "fortnight" => Relative :: Days ( multipler . checked_mul ( 14 ) ?) ,
114- "week" => Relative :: Days ( multipler . checked_mul ( 7 ) ?) ,
115- "day" => Relative :: Days ( multipler ) ,
116- "hour" => Relative :: Hours ( multipler ) ,
117- "minute" | "min" => Relative :: Minutes ( multipler ) ,
118- "second" | "sec" => Relative :: Seconds ( multipler as i64 , 0 ) ,
111+ "year" => Relative :: Years ( multiplier ) ,
112+ "month" => Relative :: Months ( multiplier ) ,
113+ "fortnight" => Relative :: Days ( multiplier . checked_mul ( 14 ) ?) ,
114+ "week" => Relative :: Days ( multiplier . checked_mul ( 7 ) ?) ,
115+ "day" => Relative :: Days ( multiplier ) ,
116+ "hour" => Relative :: Hours ( multiplier ) ,
117+ "minute" | "min" => Relative :: Minutes ( multiplier ) ,
118+ "second" | "sec" => Relative :: Seconds ( multiplier as i64 , 0 ) ,
119119 _ => return None ,
120120 } )
121121 } )
0 commit comments