aboutsummaryrefslogtreecommitdiff
path: root/src/di_container.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/di_container.rs')
-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();