From a34f7c03779aaf90f34b5ff59587daf1db42de8d Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 15 Sep 2024 23:02:34 +0200 Subject: refactor: rename factory provider to function provider --- src/di_container/blocking/binding/builder.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/di_container/blocking/binding/builder.rs') diff --git a/src/di_container/blocking/binding/builder.rs b/src/di_container/blocking/binding/builder.rs index ead1a54..345fb02 100644 --- a/src/di_container/blocking/binding/builder.rs +++ b/src/di_container/blocking/binding/builder.rs @@ -181,7 +181,10 @@ where Interface: Fn>, Func: Fn(&DIContainer) -> Box, { + use std::rc::Rc; + use crate::castable_function::CastableFunction; + use crate::provider::blocking::ProvidableFunctionKind; if self .di_container @@ -196,9 +199,9 @@ where self.di_container.set_binding::( BindingOptions::new(), - Box::new(crate::provider::blocking::FactoryProvider::new( - crate::ptr::FactoryPtr::new(factory_impl), - false, + Box::new(crate::provider::blocking::FunctionProvider::new( + Rc::new(factory_impl), + ProvidableFunctionKind::UserCalled, )), ); @@ -269,7 +272,10 @@ where dyn Fn<(), Output = crate::ptr::TransientPtr>, >, { + use std::rc::Rc; + use crate::castable_function::CastableFunction; + use crate::provider::blocking::ProvidableFunctionKind; if self .di_container @@ -284,9 +290,9 @@ where self.di_container.set_binding::( BindingOptions::new(), - Box::new(crate::provider::blocking::FactoryProvider::new( - crate::ptr::FactoryPtr::new(factory_impl), - true, + Box::new(crate::provider::blocking::FunctionProvider::new( + Rc::new(factory_impl), + ProvidableFunctionKind::Instant, )), ); -- cgit v1.2.3-18-g5258