Skip to content

Commit c5c6bf6

Browse files
committed
refactor
1 parent 956613f commit c5c6bf6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

git-date/src/parse.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,11 @@ mod relative {
118118
let seconds: i64 = match period {
119119
"second" => 1,
120120
"minute" => 60,
121-
"hour" => 3_600,
122-
"day" => 86_400,
123-
"week" => 604_800,
124-
// TODO months & years?
121+
"hour" => 60 * 60,
122+
"day" => 24 * 60 * 60,
123+
"week" => 7 * 24 * 60 * 60,
124+
// TODO months & years? YES
125+
// Ignore values you don't know, assume seconds then (so does git)
125126
_ => return None,
126127
};
127128
seconds.checked_mul(multiplier).map(Duration::seconds)

0 commit comments

Comments
 (0)