Fix builds.

This commit is contained in:
Stephen Chung 2022-05-19 21:49:19 +08:00
parent 130b93d029
commit 8f73796110
2 changed files with 6 additions and 4 deletions

View File

@ -40,7 +40,9 @@ impl LangOptions {
Self::ANON_FN Self::ANON_FN
} }
#[cfg(feature = "no_function")] #[cfg(feature = "no_function")]
0 {
Self::empty()
}
} }
} }
} }

View File

@ -12,8 +12,8 @@ use crate::engine::{
use crate::eval::{Caches, FnResolutionCacheEntry, GlobalRuntimeState}; use crate::eval::{Caches, FnResolutionCacheEntry, GlobalRuntimeState};
use crate::{ use crate::{
calc_fn_hash, calc_fn_params_hash, combine_hashes, Dynamic, Engine, FnArgsVec, FnPtr, calc_fn_hash, calc_fn_params_hash, combine_hashes, Dynamic, Engine, FnArgsVec, FnPtr,
Identifier, ImmutableString, Module, OptimizationLevel, Position, RhaiError, RhaiResult, ImmutableString, Module, OptimizationLevel, Position, RhaiError, RhaiResult, RhaiResultOf,
RhaiResultOf, Scope, ERR, Scope, ERR,
}; };
#[cfg(feature = "no_std")] #[cfg(feature = "no_std")]
use std::prelude::v1::*; use std::prelude::v1::*;
@ -661,7 +661,7 @@ impl Engine {
source source
.as_ref() .as_ref()
.map(|s| (**s).clone()) .map(|s| (**s).clone())
.unwrap_or(Identifier::new_const()), .unwrap_or(crate::Identifier::new_const()),
); );
let result = if _is_method_call { let result = if _is_method_call {