From 7204ea39ee76e5a57f826e6f8a1e0e85cedd25b0 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Wed, 22 Jan 2025 14:48:15 +0800 Subject: [PATCH 1/2] Mark FnPtr::from_fn volatile --- src/types/fn_ptr.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/types/fn_ptr.rs b/src/types/fn_ptr.rs index 1a4986a0b..e1dd9703b 100644 --- a/src/types/fn_ptr.rs +++ b/src/types/fn_ptr.rs @@ -99,6 +99,15 @@ impl FnPtr { /// # Errors /// /// Returns an error if the function name is not a valid identifier or is a reserved keyword. + /// + /// # WARNING - Unstable API + /// + /// This API is volatile and may change in the future. + /// + /// # Callback Function Signature + /// + /// `Fn(context: NativeCallContext, &mut [&mut Dynamic]) -> Result>` + #[deprecated = "This API is NOT deprecated, but it is considered volatile and may change in the future."] #[inline(always)] pub fn from_fn( name: impl Into, @@ -109,6 +118,7 @@ impl FnPtr { + Sync + 'static, ) -> RhaiResultOf { + #[allow(deprecated)] Self::from_dyn_fn(name, Box::new(func)) } /// Create a new function pointer from a native Rust function. @@ -116,6 +126,15 @@ impl FnPtr { /// # Errors /// /// Returns an error if the function name is not a valid identifier or is a reserved keyword. + /// + /// # WARNING - Unstable API + /// + /// This API is volatile and may change in the future. + /// + /// # Callback Function Signature + /// + /// `Fn(context: NativeCallContext, &mut [&mut Dynamic]) -> Result>` + #[deprecated = "This API is NOT deprecated, but it is considered volatile and may change in the future."] #[inline] pub fn from_dyn_fn( name: impl Into, From e957b2b69e0940201f10db7ca2d9baac1bfdab25 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Sat, 25 Jan 2025 13:18:42 +0800 Subject: [PATCH 2/2] Bump version --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index dbf4f039b..22163d136 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ members = [".", "codegen"] [package] name = "rhai" -version = "1.20.1" +version = "1.21.0" rust-version = "1.66.0" edition = "2018" resolver = "2"