From e4e315fb2a0d26941e137dcc93181a3ac1660a15 Mon Sep 17 00:00:00 2001 From: Tristan Guichaoua Date: Tue, 9 Aug 2022 10:14:18 +0200 Subject: [PATCH] add cfg --- src/api/build_type.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/api/build_type.rs b/src/api/build_type.rs index 3385b187..c93da739 100644 --- a/src/api/build_type.rs +++ b/src/api/build_type.rs @@ -148,7 +148,13 @@ where self.engine.register_result_fn(name, method); self } +} +#[cfg(not(feature = "no_object"))] +impl<'a, T> TypeBuilder<'a, T> +where + T: Variant + Clone, +{ /// Register a getter function. /// /// The function signature must start with `&mut self` and not `&self`. @@ -220,7 +226,13 @@ where self.engine.register_get_set(name, get_fn, set_fn); self } +} +#[cfg(any(not(feature = "no_index"), not(feature = "no_object")))] +impl<'a, T> TypeBuilder<'a, T> +where + T: Variant + Clone, +{ /// Register an index getter. /// /// The function signature must start with `&mut self` and not `&self`.