Refactor CustomType to struct CustomTypeInfo.

This commit is contained in:
Stephen Chung
2022-08-22 20:52:52 +08:00
parent db865d7538
commit 4ce8d4609d
3 changed files with 25 additions and 11 deletions

View File

@@ -586,10 +586,10 @@ impl Module {
///
/// assert_eq!(module.get_custom_type(name), Some("MyType"));
/// ```
#[inline(always)]
#[inline]
#[must_use]
pub fn get_custom_type(&self, key: &str) -> Option<&str> {
self.custom_types.get(key)
self.custom_types.get(key).map(|t| t.display_name.as_str())
}
/// Returns `true` if this [`Module`] contains no items.