Fix build.
This commit is contained in:
parent
90998f4f14
commit
e400b3627c
@ -253,6 +253,17 @@ impl fmt::Debug for Module {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(feature = "no_function"))]
|
||||||
|
impl<T: IntoIterator<Item = Shared<crate::ast::ScriptFnDef>>> From<T> for Module {
|
||||||
|
fn from(iter: T) -> Self {
|
||||||
|
let mut module = Self::new();
|
||||||
|
iter.into_iter().for_each(|fn_def| {
|
||||||
|
module.set_script_fn(fn_def);
|
||||||
|
});
|
||||||
|
module
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<M: AsRef<Module>> Add<M> for &Module {
|
impl<M: AsRef<Module>> Add<M> for &Module {
|
||||||
type Output = Module;
|
type Output = Module;
|
||||||
|
|
||||||
|
@ -3884,7 +3884,7 @@ impl Engine {
|
|||||||
return Ok(AST::new(
|
return Ok(AST::new(
|
||||||
statements,
|
statements,
|
||||||
#[cfg(not(feature = "no_function"))]
|
#[cfg(not(feature = "no_function"))]
|
||||||
functions.into_iter().map(|(.., v)| v).collect(),
|
crate::Module::from(functions.into_iter().map(|(.., v)| v)),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user