From 89c238f9c82ade2d7656e2bee76838a391609a88 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 5 Aug 2023 23:14:06 +0200 Subject: refactor!: remove IDependencyHistory BREAKING CHANGE: IDependencyHistory has been removed as part of an effort to simplify the API. This affects IDIContainer, DIContainer, IAsyncDIContainer, AsyncDIContainer, Injectable, AsyncInjectable, BindingBuilder, AsyncBindingBuilder, BindingScopeConfigurator, BindingWhenConfigurator, AsyncBindingScopeConfigurator, AsyncBindingWhenConfigurator and DependencyHistory --- .../asynchronous/binding/when_configurator.rs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'src/di_container/asynchronous/binding/when_configurator.rs') diff --git a/src/di_container/asynchronous/binding/when_configurator.rs b/src/di_container/asynchronous/binding/when_configurator.rs index 39e1807..d08239e 100644 --- a/src/di_container/asynchronous/binding/when_configurator.rs +++ b/src/di_container/asynchronous/binding/when_configurator.rs @@ -5,38 +5,32 @@ use std::any::type_name; use std::marker::PhantomData; use std::sync::Arc; -use crate::dependency_history::IDependencyHistory; use crate::di_container::asynchronous::IAsyncDIContainer; use crate::errors::async_di_container::AsyncBindingWhenConfiguratorError; /// When configurator for a binding for type `Interface` inside a [`IAsyncDIContainer`]. /// /// [`IAsyncDIContainer`]: crate::di_container::asynchronous::IAsyncDIContainer -pub struct AsyncBindingWhenConfigurator +pub struct AsyncBindingWhenConfigurator where Interface: 'static + ?Sized + Send + Sync, - DIContainerType: IAsyncDIContainer, - DependencyHistoryType: IDependencyHistory + Send + Sync, + DIContainerType: IAsyncDIContainer, { di_container: Arc, interface_phantom: PhantomData, - dependency_history_phantom: PhantomData, } -impl - AsyncBindingWhenConfigurator +impl AsyncBindingWhenConfigurator where Interface: 'static + ?Sized + Send + Sync, - DIContainerType: IAsyncDIContainer, - DependencyHistoryType: IDependencyHistory + Send + Sync, + DIContainerType: IAsyncDIContainer, { pub(crate) fn new(di_container: Arc) -> Self { Self { di_container, interface_phantom: PhantomData, - dependency_history_phantom: PhantomData, } } @@ -99,8 +93,7 @@ mod tests let binding_when_configurator = AsyncBindingWhenConfigurator::< dyn subjects_async::INumber, - mocks::async_di_container::MockAsyncDIContainer, - mocks::MockDependencyHistory, + mocks::async_di_container::MockAsyncDIContainer, >::new(Arc::new(di_container_mock)); assert!(binding_when_configurator -- cgit v1.2.3-18-g5258