From 0f2756536e8fc311119da2af5b4dcc33f41bec6e Mon Sep 17 00:00:00 2001 From: HampusM Date: Wed, 4 Oct 2023 12:51:06 +0200 Subject: refactor!: remove factory & declare_default_factory macros BREAKING CHANGE: The factory and the declare_default_factory macros have been removed. They are no longer needed to use factories --- examples/async-factory/main.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'examples/async-factory') diff --git a/examples/async-factory/main.rs b/examples/async-factory/main.rs index 83f79f0..2b796cc 100644 --- a/examples/async-factory/main.rs +++ b/examples/async-factory/main.rs @@ -7,7 +7,7 @@ use std::time::Duration; use anyhow::Result; use syrette::future::BoxFuture; use syrette::ptr::TransientPtr; -use syrette::{declare_default_factory, factory, AsyncDIContainer}; +use syrette::AsyncDIContainer; use tokio::time::sleep; trait IFoo: Send + Sync @@ -15,7 +15,6 @@ trait IFoo: Send + Sync fn bar(&self); } -#[factory(threadsafe = true)] type IFooFactory = dyn Fn(i32) -> BoxFuture<'static, TransientPtr> + Send + Sync; @@ -68,8 +67,6 @@ impl IPerson for Person } } -declare_default_factory!(dyn IPerson, async = true); - #[tokio::main] async fn main() -> Result<()> { -- cgit v1.2.3-18-g5258