Reduce BTree sizes by boxing values.

This commit is contained in:
Stephen Chung
2021-05-03 13:45:41 +08:00
parent aad842fe50
commit c749bbb653
5 changed files with 29 additions and 22 deletions

View File

@@ -265,7 +265,8 @@ impl Engine {
#[inline(always)]
pub fn register_type_with_name<T: Variant + Clone>(&mut self, name: &str) -> &mut Self {
// Add the pretty-print type name into the map
self.type_names.insert(type_name::<T>().into(), name.into());
self.type_names
.insert(type_name::<T>().into(), Box::new(name.into()));
self
}
/// Register an type iterator for an iterable type with the [`Engine`].