From 0f46bc772527c9dcf342aad97bfeebf99043a92b Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Fri, 13 Aug 2021 14:04:27 +0800 Subject: [PATCH] Fix builds. --- src/packages/math_basic.rs | 2 +- src/packages/time_basic.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/packages/math_basic.rs b/src/packages/math_basic.rs index 1f281390..2b07a5bc 100644 --- a/src/packages/math_basic.rs +++ b/src/packages/math_basic.rs @@ -429,7 +429,7 @@ mod decimal_functions { #[rhai_fn(return_raw)] pub fn parse_decimal(string: &str) -> Result> { Decimal::from_str(string) - .or_else(|_| Decimal::from_scientific(s)) + .or_else(|_| Decimal::from_scientific(string)) .map_err(|err| { EvalAltResult::ErrorArithmetic( format!("Error parsing decimal number '{}': {}", string, err), diff --git a/src/packages/time_basic.rs b/src/packages/time_basic.rs index 44961872..eeff7a50 100644 --- a/src/packages/time_basic.rs +++ b/src/packages/time_basic.rs @@ -66,8 +66,8 @@ mod time_functions { .into()); #[cfg(feature = "no_float")] - if timestamp2 > timestamp { - let seconds = (timestamp2 - timestamp).as_secs(); + if timestamp2 > timestamp1 { + let seconds = (timestamp2 - timestamp1).as_secs(); if cfg!(not(feature = "unchecked")) && seconds > (MAX_INT as u64) { Err(make_arithmetic_err(format!( @@ -78,7 +78,7 @@ mod time_functions { Ok((-(seconds as INT)).into()) } } else { - let seconds = (timestamp - timestamp2).as_secs(); + let seconds = (timestamp1 - timestamp2).as_secs(); if cfg!(not(feature = "unchecked")) && seconds > (MAX_INT as u64) { Err(make_arithmetic_err(format!(