Detect whether dynamic functions exist to save checking.

This commit is contained in:
Stephen Chung
2022-06-24 11:30:54 +08:00
parent d6bfd8f617
commit 84b8e1ed87
3 changed files with 130 additions and 63 deletions

View File

@@ -25,6 +25,11 @@ impl CustomTypesCollection {
pub fn new() -> Self {
Self(BTreeMap::new())
}
/// Clear the [`CustomTypesCollection`].
#[inline(always)]
pub fn clear(&mut self) {
self.0.clear();
}
/// Register a custom type.
#[inline(always)]
pub fn add(&mut self, type_name: impl Into<Identifier>, name: impl Into<Identifier>) {