aboutsummaryrefslogtreecommitdiff
path: root/src/di_container/blocking/binding/when_configurator.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/di_container/blocking/binding/when_configurator.rs')
-rw-r--r--src/di_container/blocking/binding/when_configurator.rs17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/di_container/blocking/binding/when_configurator.rs b/src/di_container/blocking/binding/when_configurator.rs
index 31b1b48..fcef377 100644
--- a/src/di_container/blocking/binding/when_configurator.rs
+++ b/src/di_container/blocking/binding/when_configurator.rs
@@ -5,38 +5,32 @@ use std::any::type_name;
use std::marker::PhantomData;
use std::rc::Rc;
-use crate::dependency_history::IDependencyHistory;
use crate::di_container::blocking::IDIContainer;
use crate::errors::di_container::BindingWhenConfiguratorError;
/// When configurator for a binding for type `Interface` inside a [`IDIContainer`].
///
/// [`IDIContainer`]: crate::di_container::blocking::IDIContainer
-pub struct BindingWhenConfigurator<Interface, DIContainerType, DependencyHistoryType>
+pub struct BindingWhenConfigurator<Interface, DIContainerType>
where
Interface: 'static + ?Sized,
- DIContainerType: IDIContainer<DependencyHistoryType>,
- DependencyHistoryType: IDependencyHistory,
+ DIContainerType: IDIContainer,
{
di_container: Rc<DIContainerType>,
interface_phantom: PhantomData<Interface>,
- dependency_history_phantom: PhantomData<DependencyHistoryType>,
}
-impl<Interface, DIContainerType, DependencyHistoryType>
- BindingWhenConfigurator<Interface, DIContainerType, DependencyHistoryType>
+impl<Interface, DIContainerType> BindingWhenConfigurator<Interface, DIContainerType>
where
Interface: 'static + ?Sized,
- DIContainerType: IDIContainer<DependencyHistoryType>,
- DependencyHistoryType: IDependencyHistory,
+ DIContainerType: IDIContainer,
{
pub(crate) fn new(di_container: Rc<DIContainerType>) -> Self
{
Self {
di_container,
interface_phantom: PhantomData,
- dependency_history_phantom: PhantomData,
}
}
@@ -97,8 +91,7 @@ mod tests
let binding_when_configurator = BindingWhenConfigurator::<
dyn subjects::INumber,
- mocks::blocking_di_container::MockDIContainer<mocks::MockDependencyHistory>,
- mocks::MockDependencyHistory,
+ mocks::blocking_di_container::MockDIContainer,
>::new(Rc::new(di_container_mock));
assert!(binding_when_configurator.when_named("cool").is_ok());