aboutsummaryrefslogtreecommitdiff
path: root/src/test_utils.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2023-09-18 22:35:58 +0200
committerHampusM <hampus@hampusmat.com>2023-09-18 22:35:58 +0200
commit4fd0d6b4951b08a20d5378bca75561109dc6d036 (patch)
tree8496d679e7ee3debcd415ed563911e2166594212 /src/test_utils.rs
parentde2e1349f459f7f69226b2decd366be690426ea7 (diff)
refactor!: make the async DI container not inside a Arc
BREAKING CHANGE: The async DI container is no longer inside of a Arc. This affects AsyncBindingBuilder, AsyncBindingScopeConfigurator, AsyncBindingWhenConfigurator & AsyncInjectable
Diffstat (limited to 'src/test_utils.rs')
-rw-r--r--src/test_utils.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/test_utils.rs b/src/test_utils.rs
index 6071cfb..491e9b4 100644
--- a/src/test_utils.rs
+++ b/src/test_utils.rs
@@ -138,7 +138,6 @@ pub mod subjects_async
//! Test subjects.
use std::fmt::Debug;
- use std::sync::Arc;
use async_trait::async_trait;
use syrette_macros::declare_interface;
@@ -187,7 +186,7 @@ pub mod subjects_async
impl<DIContainerType> AsyncInjectable<DIContainerType> for UserManager
{
async fn resolve(
- _: &Arc<DIContainerType>,
+ _: &DIContainerType,
_dependency_history: DependencyHistory,
) -> Result<TransientPtr<Self>, crate::errors::injectable::InjectableError>
where
@@ -252,7 +251,7 @@ pub mod subjects_async
impl<DIContainerType> AsyncInjectable<DIContainerType> for Number
{
async fn resolve(
- _: &Arc<DIContainerType>,
+ _: &DIContainerType,
_dependency_history: DependencyHistory,
) -> Result<TransientPtr<Self>, crate::errors::injectable::InjectableError>
where
@@ -271,8 +270,6 @@ pub mod mocks
#[cfg(feature = "async")]
pub mod async_provider
{
- use std::sync::Arc;
-
use async_trait::async_trait;
use mockall::mock;
@@ -293,7 +290,7 @@ pub mod mocks
{
async fn provide(
&self,
- di_container: &Arc<DIContainerT>,
+ di_container: &DIContainerT,
dependency_history: DependencyHistory
) -> Result<AsyncProvidable<DIContainerT>, InjectableError>;