From de2e1349f459f7f69226b2decd366be690426ea7 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 18 Sep 2023 21:45:23 +0200 Subject: refactor: replace threadsafe castable factory Fn impl with method --- src/di_container/asynchronous/mod.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/di_container/asynchronous') diff --git a/src/di_container/asynchronous/mod.rs b/src/di_container/asynchronous/mod.rs index e651d81..827364d 100644 --- a/src/di_container/asynchronous/mod.rs +++ b/src/di_container/asynchronous/mod.rs @@ -299,7 +299,9 @@ impl AsyncDIContainer } })?; - Ok(SomePtr::ThreadsafeFactory(factory(self.clone()).into())) + Ok(SomePtr::ThreadsafeFactory( + factory.call(self.clone()).into(), + )) } #[cfg(feature = "factory")] AsyncProvidable::DefaultFactory(binding) => { @@ -315,7 +317,7 @@ impl AsyncDIContainer DefaultFactoryFn, >(binding, "default factory")?; - Ok(SomePtr::Transient(default_factory(self.clone())())) + Ok(SomePtr::Transient(default_factory.call(self.clone())())) } #[cfg(feature = "factory")] AsyncProvidable::AsyncDefaultFactory(binding) => { @@ -337,7 +339,7 @@ impl AsyncDIContainer )?; Ok(SomePtr::Transient( - async_default_factory(self.clone())().await, + async_default_factory.call(self.clone())().await, )) } } -- cgit v1.2.3-18-g5258