diff options
author | HampusM <hampus@hampusmat.com> | 2022-10-02 20:03:49 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-10-02 20:03:49 +0200 |
commit | 846720a4168fcd6de54a4c59152bac785c866a18 (patch) | |
tree | 6288af4c32be86b076a39f9512c30a6cca39a103 /src/di_container.rs | |
parent | 6dc7ed9c0c5de55621fb5625cdf08d93d1ca0f51 (diff) |
refactor: clarify binding builder to_factory signature
Diffstat (limited to 'src/di_container.rs')
-rw-r--r-- | src/di_container.rs | 8 |
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(); |