From a9ff2f16812b56107604400a64a7f482d017eca1 Mon Sep 17 00:00:00 2001 From: HampusM Date: Wed, 31 Aug 2022 21:41:27 +0200 Subject: feat: add a threadsafe flag to the declare_default_factory macro --- src/lib.rs | 43 ------------------------------------------- 1 file changed, 43 deletions(-) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index 9fdfa0f..2155350 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -75,46 +75,3 @@ macro_rules! di_container_bind { syrette::declare_interface!($implementation -> $interface); }; } - -/// Shortcut for declaring a default factory. -/// -/// A default factory is a factory that doesn't take any arguments. -/// -/// The more tedious way to accomplish what this macro does would be by using -/// the [`factory`] macro. -/// -/// *This macro is only available if Syrette is built with the "factory" feature.* -/// -/// # Arguments -/// - Interface trait -/// -/// # Examples -/// ``` -/// # use syrette::declare_default_factory; -/// # -/// trait IParser -/// { -/// // Methods and etc here... -/// } -/// -/// declare_default_factory!(dyn IParser); -/// ``` -#[macro_export] -#[cfg(feature = "factory")] -macro_rules! declare_default_factory { - ($interface: ty) => { - syrette::declare_interface!( - syrette::castable_factory::blocking::CastableFactory< - (), - $interface, - > -> syrette::interfaces::factory::IFactory<(), $interface> - ); - - syrette::declare_interface!( - syrette::castable_factory::blocking::CastableFactory< - (), - $interface, - > -> syrette::interfaces::any_factory::AnyFactory - ); - } -} -- cgit v1.2.3-18-g5258