Expose Engine::map_type_name.

This commit is contained in:
Stephen Chung 2021-02-25 11:04:01 +08:00
parent 1c1dfc701f
commit f03983a9ca

View File

@ -2573,9 +2573,12 @@ impl Engine {
Ok(()) Ok(())
} }
/// Map a type_name into a pretty-print name /// Pretty-print a type name.
///
/// If a type is registered via [`register_type_with_name`][Engine::register_type_with_name],
/// the type name provided for the registration will be used.
#[inline(always)] #[inline(always)]
pub(crate) fn map_type_name<'a>(&'a self, name: &'a str) -> &'a str { pub fn map_type_name<'a>(&'a self, name: &'a str) -> &'a str {
self.type_names self.type_names
.get(name) .get(name)
.map(String::as_str) .map(String::as_str)