aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-10-02 20:03:49 +0200
committerHampusM <hampus@hampusmat.com>2022-10-02 20:03:49 +0200
commit846720a4168fcd6de54a4c59152bac785c866a18 (patch)
tree6288af4c32be86b076a39f9512c30a6cca39a103 /src
parent6dc7ed9c0c5de55621fb5625cdf08d93d1ca0f51 (diff)
refactor: clarify binding builder to_factory signature
Diffstat (limited to 'src')
-rw-r--r--src/di_container.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/di_container.rs b/src/di_container.rs
index 4d43e8a..068a798 100644
--- a/src/di_container.rs
+++ b/src/di_container.rs
@@ -334,17 +334,15 @@ where
/// # }
/// ```
#[feature_specific("factory")]
- pub fn to_factory<Args, Return>(
+ pub fn to_factory<Args, Return, Func>(
&self,
- factory_func: &'static dyn Fn<
- (std::rc::Rc<DIContainer>,),
- Output = Box<dyn Fn<Args, Output = crate::ptr::TransientPtr<Return>>>,
- >,
+ factory_func: &'static Func,
) -> Result<BindingWhenConfigurator<Interface>, BindingBuilderError>
where
Args: 'static,
Return: 'static + ?Sized,
Interface: Fn<Args, Output = crate::ptr::TransientPtr<Return>>,
+ Func: Fn<(std::rc::Rc<DIContainer>,), Output = Box<Interface>>,
{
{
let bindings = self.di_container.bindings.borrow();