aboutsummaryrefslogtreecommitdiff
path: root/src/di_container/blocking/binding/builder.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2023-10-03 19:38:22 +0200
committerHampusM <hampus@hampusmat.com>2023-10-03 19:38:22 +0200
commit613bf4a8a094df6f048cc8b1fcf2fc425abddd99 (patch)
tree43981a48e4e09ad4c0b96b679184ce6ecb6f4e9f /src/di_container/blocking/binding/builder.rs
parente0d399133b0c06011c9b775fd545ce649be37ff4 (diff)
refactor: remove inner mutability of blocking DI container
Diffstat (limited to 'src/di_container/blocking/binding/builder.rs')
-rw-r--r--src/di_container/blocking/binding/builder.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/di_container/blocking/binding/builder.rs b/src/di_container/blocking/binding/builder.rs
index cd547d4..f322809 100644
--- a/src/di_container/blocking/binding/builder.rs
+++ b/src/di_container/blocking/binding/builder.rs
@@ -19,7 +19,7 @@ pub struct BindingBuilder<'di_container, Interface>
where
Interface: 'static + ?Sized,
{
- di_container: &'di_container DIContainer,
+ di_container: &'di_container mut DIContainer,
dependency_history_factory: fn() -> DependencyHistory,
interface_phantom: PhantomData<Interface>,
@@ -30,7 +30,7 @@ where
Interface: 'static + ?Sized,
{
pub(crate) fn new(
- di_container: &'di_container DIContainer,
+ di_container: &'di_container mut DIContainer,
dependency_history_factory: fn() -> DependencyHistory,
) -> Self
{
@@ -98,7 +98,7 @@ where
>()));
}
- let binding_scope_configurator = BindingScopeConfigurator::new(
+ let mut binding_scope_configurator = BindingScopeConfigurator::new(
self.di_container,
self.dependency_history_factory,
);
@@ -324,7 +324,7 @@ mod tests
.once();
let binding_builder = BindingBuilder::<dyn subjects::INumber>::new(
- &mock_di_container,
+ &mut mock_di_container,
MockDependencyHistory::new,
);
@@ -358,7 +358,7 @@ mod tests
.once();
let binding_builder = BindingBuilder::<IUserManagerFactory>::new(
- &mock_di_container,
+ &mut mock_di_container,
MockDependencyHistory::new,
);
@@ -400,7 +400,7 @@ mod tests
.once();
let binding_builder = BindingBuilder::<dyn subjects::IUserManager>::new(
- &mock_di_container,
+ &mut mock_di_container,
MockDependencyHistory::new,
);