fix: use checked_mul() to avoid overflow with week

This commit is contained in:
Daniel Hofstetter
2025-08-22 14:46:54 +02:00
parent 91692a17e0
commit 871cae962e
+1 -1
View File
@@ -111,7 +111,7 @@ fn displacement(input: &mut &str) -> ModalResult<Relative> {
"year" => Relative::Years(multipler),
"month" => Relative::Months(multipler),
"fortnight" => Relative::Days(multipler.checked_mul(14)?),
"week" => Relative::Days(7 * multipler),
"week" => Relative::Days(multipler.checked_mul(7)?),
"day" => Relative::Days(multipler),
"hour" => Relative::Hours(multipler),
"minute" | "min" => Relative::Minutes(multipler),