aboutsummaryrefslogtreecommitdiff
path: root/examples/async-factory
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2023-10-04 12:51:06 +0200
committerHampusM <hampus@hampusmat.com>2023-10-04 12:52:22 +0200
commit0f2756536e8fc311119da2af5b4dcc33f41bec6e (patch)
tree0964efe0eaf855017c67fae52da8672a47becc65 /examples/async-factory
parentc936439bfac9e35958f685a52abb51d781e70a7c (diff)
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
Diffstat (limited to 'examples/async-factory')
-rw-r--r--examples/async-factory/main.rs5
1 files changed, 1 insertions, 4 deletions
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<dyn IFoo>> + Send + Sync;
@@ -68,8 +67,6 @@ impl IPerson for Person
}
}
-declare_default_factory!(dyn IPerson, async = true);
-
#[tokio::main]
async fn main() -> Result<()>
{