diff --git a/src/ast.rs b/src/ast.rs index e6694324..65667c80 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -1245,6 +1245,7 @@ mod tests { assert_eq!(size_of::>(), 16); assert_eq!(size_of::(), 32); assert_eq!(size_of::>(), 32); + assert_eq!(size_of::(), 32); assert_eq!(size_of::(), 48); assert_eq!(size_of::(), 56); assert_eq!(size_of::(), 16); diff --git a/src/fn_native.rs b/src/fn_native.rs index 949b1071..324ff54a 100644 --- a/src/fn_native.rs +++ b/src/fn_native.rs @@ -10,11 +10,12 @@ use crate::stdlib::{ iter::empty, mem, string::String, + vec::Vec, }; use crate::token::is_valid_identifier; use crate::{ calc_script_fn_hash, Dynamic, Engine, EvalAltResult, EvalContext, ImmutableString, Module, - Position, StaticVec, + Position, }; #[cfg(not(feature = "sync"))] @@ -237,7 +238,7 @@ pub type FnCallArgs<'a> = [&'a mut Dynamic]; /// A general function pointer, which may carry additional (i.e. curried) argument values /// to be passed onto a function during a call. #[derive(Debug, Clone)] -pub struct FnPtr(ImmutableString, StaticVec); +pub struct FnPtr(ImmutableString, Vec); impl FnPtr { /// Create a new function pointer. @@ -247,10 +248,7 @@ impl FnPtr { } /// Create a new function pointer without checking its parameters. #[inline(always)] - pub(crate) fn new_unchecked( - name: impl Into, - curry: StaticVec, - ) -> Self { + pub(crate) fn new_unchecked(name: impl Into, curry: Vec) -> Self { Self(name.into(), curry) } /// Get the name of the function. @@ -265,7 +263,7 @@ impl FnPtr { } /// Get the underlying data of the function pointer. #[inline(always)] - pub(crate) fn take_data(self) -> (ImmutableString, StaticVec) { + pub(crate) fn take_data(self) -> (ImmutableString, Vec) { (self.0, self.1) } /// Get the curried arguments. @@ -320,9 +318,9 @@ impl FnPtr { .iter() .cloned() .chain(arg_values.iter_mut().map(mem::take)) - .collect::>(); + .collect::>(); - let mut args = args_data.iter_mut().collect::>(); + let mut args = args_data.iter_mut().collect::>(); let is_method = this_ptr.is_some();