From 5370031068f188563183d02189caf38a4c6b2f3b Mon Sep 17 00:00:00 2001 From: Tristan Guichaoua Date: Tue, 9 Aug 2022 10:15:49 +0200 Subject: [PATCH] inline methods --- src/api/build_type.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/api/build_type.rs b/src/api/build_type.rs index c93da739..8f8cc497 100644 --- a/src/api/build_type.rs +++ b/src/api/build_type.rs @@ -77,6 +77,7 @@ impl Engine { /// /// See [`CustomType`]. #[deprecated = "This API is NOT deprecated, but it is considered volatile and may change in the future."] + #[inline] pub fn build_type(&mut self) -> &mut Self where T: CustomType, @@ -107,6 +108,7 @@ impl<'a, T> TypeBuilder<'a, T> where T: Variant + Clone, { + #[inline] fn new(engine: &'a mut Engine) -> Self { Self { engine, @@ -161,6 +163,7 @@ where /// /// Not available under `no_object`. #[deprecated = "This API is NOT deprecated, but it is considered volatile and may change in the future."] + #[inline] pub fn with_get( &mut self, name: impl AsRef, @@ -176,6 +179,7 @@ where /// /// Not available under `no_object`. #[deprecated = "This API is NOT deprecated, but it is considered volatile and may change in the future."] + #[inline] pub fn with_get_result( &mut self, name: impl AsRef, @@ -189,6 +193,7 @@ where /// /// Not available under `no_object`. #[deprecated = "This API is NOT deprecated, but it is considered volatile and may change in the future."] + #[inline] pub fn with_set( &mut self, name: impl AsRef, @@ -202,6 +207,7 @@ where /// /// Not available under `no_object`. #[deprecated = "This API is NOT deprecated, but it is considered volatile and may change in the future."] + #[inline] pub fn with_set_result( &mut self, name: impl AsRef, @@ -217,6 +223,7 @@ where /// /// Not available under `no_object`. #[deprecated = "This API is NOT deprecated, but it is considered volatile and may change in the future."] + #[inline] pub fn with_get_set( &mut self, name: impl AsRef, @@ -239,6 +246,7 @@ where /// /// Not available under both `no_index` and `no_object`. #[deprecated = "This API is NOT deprecated, but it is considered volatile and may change in the future."] + #[inline] pub fn with_indexer_get( &mut self, get_fn: impl Fn(&mut T, X) -> V + SendSync + 'static, @@ -253,6 +261,7 @@ where /// /// Not available under both `no_index` and `no_object`. #[deprecated = "This API is NOT deprecated, but it is considered volatile and may change in the future."] + #[inline] pub fn with_indexer_get_result( &mut self, get_fn: impl Fn(&mut T, X) -> RhaiResultOf + SendSync + 'static, @@ -265,6 +274,7 @@ where /// /// Not available under both `no_index` and `no_object`. #[deprecated = "This API is NOT deprecated, but it is considered volatile and may change in the future."] + #[inline] pub fn with_indexer_set( &mut self, set_fn: impl Fn(&mut T, X, V) + SendSync + 'static, @@ -277,6 +287,7 @@ where /// /// Not available under both `no_index` and `no_object`. #[deprecated = "This API is NOT deprecated, but it is considered volatile and may change in the future."] + #[inline] pub fn with_indexer_set_result( &mut self, set_fn: impl Fn(&mut T, X, V) -> RhaiResultOf<()> + SendSync + 'static, @@ -289,6 +300,7 @@ where /// /// Not available under both `no_index` and `no_object`. #[deprecated = "This API is NOT deprecated, but it is considered volatile and may change in the future."] + #[inline] pub fn with_indexer_get_set( &mut self, get_fn: impl Fn(&mut T, X) -> V + SendSync + 'static, @@ -303,6 +315,7 @@ impl<'a, T> Drop for TypeBuilder<'a, T> where T: Variant + Clone, { + #[inline] fn drop(&mut self) { if let Some(name) = self.name { self.engine.register_type_with_name::(name);