Use macro auto_restore!.

This commit is contained in:
Stephen Chung
2022-12-04 14:06:54 +08:00
parent 58769dbb52
commit de0707f64f
23 changed files with 122 additions and 162 deletions

View File

@@ -185,7 +185,7 @@ impl Engine {
/// This method will be removed in the next major version.
#[deprecated(since = "1.9.1", note = "use `register_fn` instead")]
#[inline(always)]
pub fn register_result_fn<A, const N: usize, const C: bool, R: Variant + Clone>(
pub fn register_result_fn<A: 'static, const N: usize, const C: bool, R: Variant + Clone>(
&mut self,
name: impl AsRef<str> + Into<Identifier>,
func: impl RegisterNativeFunction<A, N, C, R, true>,
@@ -514,7 +514,7 @@ impl<'a, T: Variant + Clone> TypeBuilder<'a, T> {
/// This method will be removed in the next major version.
#[deprecated(since = "1.9.1", note = "use `with_fn` instead")]
#[inline(always)]
pub fn with_result_fn<S, A, const N: usize, const C: bool, R, F>(
pub fn with_result_fn<S, A: 'static, const N: usize, const C: bool, R, F>(
&mut self,
name: S,
method: F,