fix no_module.

This commit is contained in:
Stephen Chung 2022-03-19 10:29:21 +08:00
parent fefa633cf0
commit 1b3d5aeb53

View File

@ -89,9 +89,13 @@ impl Engine {
.iter() .iter()
.find_map(|m| m.get_custom_type(name)) .find_map(|m| m.get_custom_type(name))
.or_else(|| { .or_else(|| {
self.global_sub_modules #[cfg(not(feature = "no_module"))]
return self
.global_sub_modules
.iter() .iter()
.find_map(|(_, m)| m.get_custom_type(name)) .find_map(|(_, m)| m.get_custom_type(name));
#[cfg(feature = "no_module")]
return None;
}) })
.or_else(|| self.custom_types.get(name)) .or_else(|| self.custom_types.get(name))
.unwrap_or_else(|| map_std_type_name(name, true)) .unwrap_or_else(|| map_std_type_name(name, true))