aboutsummaryrefslogtreecommitdiff
path: root/src/di_container/asynchronous/mod.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2023-09-18 21:45:23 +0200
committerHampusM <hampus@hampusmat.com>2023-09-18 21:45:23 +0200
commitde2e1349f459f7f69226b2decd366be690426ea7 (patch)
tree8312e49ae6007e5226a6ed9e3262855e40b06095 /src/di_container/asynchronous/mod.rs
parent6d729a4d20944b990c341149729a810a2898cdff (diff)
refactor: replace threadsafe castable factory Fn impl with method
Diffstat (limited to 'src/di_container/asynchronous/mod.rs')
-rw-r--r--src/di_container/asynchronous/mod.rs8
1 files changed, 5 insertions, 3 deletions
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<Interface>,
>(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,
))
}
}