Change lib to &[Shared<Module>] and remove dummy lifetimes.

This commit is contained in:
Stephen Chung
2022-11-07 16:18:59 +08:00
parent 4455d95abc
commit 0c79471fd3
16 changed files with 93 additions and 94 deletions

View File

@@ -4,8 +4,8 @@
use crate::eval::{Caches, GlobalRuntimeState};
use crate::types::dynamic::Variant;
use crate::{
reify, Dynamic, Engine, FuncArgs, Position, RhaiResult, RhaiResultOf, Scope, StaticVec, AST,
ERR,
reify, Dynamic, Engine, FuncArgs, Position, RhaiResult, RhaiResultOf, Scope, Shared, StaticVec,
AST, ERR,
};
use std::any::{type_name, TypeId};
#[cfg(feature = "no_std")]
@@ -248,7 +248,7 @@ impl Engine {
arg_values: &mut [Dynamic],
) -> RhaiResult {
let statements = ast.statements();
let lib = &[ast.as_ref()];
let lib = &[AsRef::<Shared<_>>::as_ref(ast).clone()];
let mut this_ptr = this_ptr;
let orig_scope_len = scope.len();