@@ -3,25 +3,21 @@ use crate::RRuleError;
33pub ( crate ) fn checked_mul_u32 ( v1 : u32 , v2 : u32 , hint : Option < & str > ) -> Result < u32 , RRuleError > {
44 v1. checked_mul ( v2) . ok_or_else ( || match hint {
55 Some ( hint) => RRuleError :: new_iter_err ( format ! (
6- "Could not multiply number, would overflow (`{} * {}`), {}." ,
7- v1, v2, hint
6+ "Could not multiply number, would overflow (`{v1} * {v2}`), {hint}."
87 ) ) ,
98 None => RRuleError :: new_iter_err ( format ! (
10- "Could not multiply number, would overflow (`{} * {}`)." ,
11- v1, v2,
9+ "Could not multiply number, would overflow (`{v1} * {v2}`)." ,
1210 ) ) ,
1311 } )
1412}
1513
1614pub ( crate ) fn checked_add_u32 ( v1 : u32 , v2 : u32 , hint : Option < & str > ) -> Result < u32 , RRuleError > {
1715 v1. checked_add ( v2) . ok_or_else ( || match hint {
1816 Some ( hint) => RRuleError :: new_iter_err ( format ! (
19- "Could not add numbers, would overflow (`{} + {}`), {}." ,
20- v1, v2, hint
17+ "Could not add numbers, would overflow (`{v1} + {v2}`), {hint}."
2118 ) ) ,
2219 None => RRuleError :: new_iter_err ( format ! (
23- "Could not add numbers, would overflow (`{} + {}`)." ,
24- v1, v2,
20+ "Could not add numbers, would overflow (`{v1} + {v2}`)." ,
2521 ) ) ,
2622 } )
2723}
0 commit comments