Fix no_function build.
This commit is contained in:
parent
b4529b6a64
commit
cba914db95
@ -122,12 +122,12 @@ impl Engine {
|
||||
|
||||
let statements = ast.statements();
|
||||
if !statements.is_empty() {
|
||||
let lib = [
|
||||
let lib: &[crate::Shared<crate::Module>] = &[
|
||||
#[cfg(not(feature = "no_function"))]
|
||||
AsRef::<crate::Shared<_>>::as_ref(ast).clone(),
|
||||
AsRef::<crate::Shared<crate::Module>>::as_ref(ast).clone(),
|
||||
];
|
||||
let lib = if lib.first().map_or(true, |m| m.is_empty()) {
|
||||
&lib[0..0]
|
||||
&[][..]
|
||||
} else {
|
||||
&lib
|
||||
};
|
||||
|
@ -150,17 +150,15 @@ impl FnPtr {
|
||||
let mut arg_values = crate::StaticVec::new_const();
|
||||
args.parse(&mut arg_values);
|
||||
|
||||
let lib = [
|
||||
let lib: &[crate::Shared<crate::Module>] = &[
|
||||
#[cfg(not(feature = "no_function"))]
|
||||
AsRef::<crate::Shared<_>>::as_ref(ast).clone(),
|
||||
AsRef::<crate::Shared<crate::Module>>::as_ref(ast).clone(),
|
||||
];
|
||||
let lib = if lib.first().map_or(true, |m| m.is_empty()) {
|
||||
&lib[0..0]
|
||||
&[][..]
|
||||
} else {
|
||||
&lib
|
||||
};
|
||||
#[cfg(feature = "no_function")]
|
||||
let lib = &[];
|
||||
|
||||
#[allow(deprecated)]
|
||||
let ctx = NativeCallContext::new(engine, self.fn_name(), lib);
|
||||
|
Loading…
Reference in New Issue
Block a user