diff --git a/src/ast.rs b/src/ast.rs index 4a82fb67..614ab18e 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -866,7 +866,7 @@ pub struct FnCallInfo { /// and the function names are predictable, so no need to allocate a new `String`. pub name: Cow<'static, str>, /// Namespace of the function, if any. - pub namespace: Option>, + pub namespace: Option, /// Call native functions only? Set to `true` to skip searching for script-defined function overrides /// when it is certain that the function must be native (e.g. an operator). pub native_only: bool, @@ -904,7 +904,7 @@ pub enum Expr { /// FnPtr constant. FnPointer(Box), /// Variable access - ((variable name, position), optional modules, hash, optional index) - Variable(Box<(Ident, Option>, u64, Option)>), + Variable(Box<(Ident, Option, u64, Option)>), /// Property access. Property(Box<(IdentX, (String, String))>), /// { stmt } diff --git a/src/engine.rs b/src/engine.rs index b08164ba..3e9f12cc 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -589,7 +589,7 @@ fn default_print(_s: &str) { pub fn search_imports<'s>( mods: &'s Imports, state: &mut State, - modules: &Box, + modules: &ModuleRef, ) -> Result<&'s Module, Box> { let (root, root_pos) = &modules[0]; @@ -617,7 +617,7 @@ pub fn search_imports<'s>( pub fn search_imports_mut<'s>( mods: &'s mut Imports, state: &mut State, - modules: &Box, + modules: &ModuleRef, ) -> Result<&'s mut Module, Box> { let (root, root_pos) = &modules[0]; diff --git a/src/fn_call.rs b/src/fn_call.rs index 78c381a3..0ae48900 100644 --- a/src/fn_call.rs +++ b/src/fn_call.rs @@ -1094,7 +1094,7 @@ impl Engine { state: &mut State, lib: &[&Module], this_ptr: &mut Option<&mut Dynamic>, - modules: &Option>, + modules: &Option, name: &str, args_expr: impl AsRef<[Expr]>, def_val: Option, diff --git a/src/parser.rs b/src/parser.rs index ebdbe625..6aae8d77 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -265,7 +265,7 @@ fn parse_fn_call( lib: &mut FunctionsLib, id: String, capture: bool, - mut namespace: Option>, + mut namespace: Option, settings: ParseSettings, ) -> Result { let (token, token_pos) = input.peek().unwrap(); @@ -898,7 +898,7 @@ fn parse_primary( } else { let mut m: ModuleRef = Default::default(); m.push((name, pos)); - modules = Some(Box::new(m)); + modules = Some(m); } Expr::Variable(Box::new((Ident::new(id2, pos2), modules, 0, index)))