Skip to content

Commit a85b9c1

Browse files
authored
Merge pull request #957 from schungx/master
Prepare 1.21.0 release
2 parents 4ead53e + e957b2b commit a85b9c1

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ members = [".", "codegen"]
33

44
[package]
55
name = "rhai"
6-
version = "1.20.1"
6+
version = "1.21.0"
77
rust-version = "1.66.0"
88
edition = "2018"
99
resolver = "2"

src/types/fn_ptr.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,15 @@ impl FnPtr {
9999
/// # Errors
100100
///
101101
/// Returns an error if the function name is not a valid identifier or is a reserved keyword.
102+
///
103+
/// # WARNING - Unstable API
104+
///
105+
/// This API is volatile and may change in the future.
106+
///
107+
/// # Callback Function Signature
108+
///
109+
/// `Fn(context: NativeCallContext, &mut [&mut Dynamic]) -> Result<Dynamic, Box<EvalAltResult>>`
110+
#[deprecated = "This API is NOT deprecated, but it is considered volatile and may change in the future."]
102111
#[inline(always)]
103112
pub fn from_fn(
104113
name: impl Into<ImmutableString>,
@@ -109,13 +118,23 @@ impl FnPtr {
109118
+ Sync
110119
+ 'static,
111120
) -> RhaiResultOf<Self> {
121+
#[allow(deprecated)]
112122
Self::from_dyn_fn(name, Box::new(func))
113123
}
114124
/// Create a new function pointer from a native Rust function.
115125
///
116126
/// # Errors
117127
///
118128
/// Returns an error if the function name is not a valid identifier or is a reserved keyword.
129+
///
130+
/// # WARNING - Unstable API
131+
///
132+
/// This API is volatile and may change in the future.
133+
///
134+
/// # Callback Function Signature
135+
///
136+
/// `Fn(context: NativeCallContext, &mut [&mut Dynamic]) -> Result<Dynamic, Box<EvalAltResult>>`
137+
#[deprecated = "This API is NOT deprecated, but it is considered volatile and may change in the future."]
119138
#[inline]
120139
pub fn from_dyn_fn(
121140
name: impl Into<ImmutableString>,

0 commit comments

Comments
 (0)