From dfd31e08574595ae9270e6b128ee126255633206 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Tue, 12 Dec 2023 15:35:00 +0800 Subject: [PATCH] Fix features. --- src/packages/time_basic.rs | 4 ++-- tests/time.rs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/packages/time_basic.rs b/src/packages/time_basic.rs index 9f431488b..7248619f6 100644 --- a/src/packages/time_basic.rs +++ b/src/packages/time_basic.rs @@ -200,7 +200,7 @@ mod time_functions { #[inline] fn add_impl(timestamp: Instant, seconds: INT) -> RhaiResultOf { if seconds < 0 { - subtract_inner(timestamp, seconds.unsigned_abs()) + subtract_inner(timestamp, seconds.unsigned_abs() as u64) } else { #[allow(clippy::cast_sign_loss)] add_inner(timestamp, seconds as u64) @@ -222,7 +222,7 @@ mod time_functions { #[inline] fn subtract_impl(timestamp: Instant, seconds: INT) -> RhaiResultOf { if seconds < 0 { - add_inner(timestamp, seconds.unsigned_abs()) + add_inner(timestamp, seconds.unsigned_abs() as u64) } else { #[allow(clippy::cast_sign_loss)] subtract_inner(timestamp, seconds as u64) diff --git a/tests/time.rs b/tests/time.rs index c66a094d3..d10258d21 100644 --- a/tests/time.rs +++ b/tests/time.rs @@ -118,5 +118,6 @@ fn test_timestamp_op() { ); // Check edge case for crashes + #[cfg(not(feature = "unchecked"))] let _ = engine.run("timestamp()-24>>-60"); }