From 963af0653e2672cc5784928bfb54c7e07ab75a6a Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Wed, 9 Mar 2022 09:41:53 +0800 Subject: [PATCH] Fix sleep function. --- src/packages/lang_core.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/packages/lang_core.rs b/src/packages/lang_core.rs index a2cd5150..41d91c01 100644 --- a/src/packages/lang_core.rs +++ b/src/packages/lang_core.rs @@ -82,7 +82,8 @@ mod core_functions { /// Block the current thread for a particular number of `seconds`. #[cfg(not(feature = "no_float"))] - #[rhai_fn(name = "float")] + #[cfg(not(feature = "no_std"))] + #[rhai_fn(name = "sleep")] pub fn sleep_float(seconds: FLOAT) { if seconds <= 0.0 { return; @@ -95,6 +96,7 @@ mod core_functions { } /// Block the current thread for a particular number of `seconds`. + #[cfg(not(feature = "no_std"))] pub fn sleep(seconds: INT) { if seconds <= 0 { return;