From 1b3d5aeb53a4ffab4fd3b902fa9a8e8d68f16e86 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Sat, 19 Mar 2022 10:29:21 +0800 Subject: [PATCH] fix no_module. --- src/api/type_names.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/api/type_names.rs b/src/api/type_names.rs index bf9ac7da..9c4ca5ea 100644 --- a/src/api/type_names.rs +++ b/src/api/type_names.rs @@ -89,9 +89,13 @@ impl Engine { .iter() .find_map(|m| m.get_custom_type(name)) .or_else(|| { - self.global_sub_modules + #[cfg(not(feature = "no_module"))] + return self + .global_sub_modules .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)) .unwrap_or_else(|| map_std_type_name(name, true))