Fix no_std build.

This commit is contained in:
Stephen Chung
2020-04-24 12:39:24 +08:00
parent a306979a9c
commit b6d839c8a9
20 changed files with 238 additions and 167 deletions

View File

@@ -923,10 +923,15 @@ impl Engine {
) -> Result<T, Box<EvalAltResult>> {
let mut arg_values = args.into_vec();
let mut args: Vec<_> = arg_values.iter_mut().collect();
let fn_lib = Some(ast.1.as_ref());
let fn_lib = ast.1.as_ref();
let pos = Position::none();
let result = self.call_fn_raw(Some(scope), fn_lib, name, &mut args, None, pos, 0)?;
let fn_def = fn_lib
.get_function(name, args.len())
.ok_or_else(|| Box::new(EvalAltResult::ErrorFunctionNotFound(name.to_string(), pos)))?;
let result =
self.call_fn_from_lib(Some(scope), Some(&fn_lib), fn_def, &mut args, pos, 0)?;
let return_type = self.map_type_name(result.type_name());