aboutsummaryrefslogtreecommitdiff
path: root/src/di_container.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-07-27 14:43:51 +0200
committerHampusM <hampus@hampusmat.com>2022-07-27 14:43:51 +0200
commit224e59112e65ce6cbafe5a87dba031dd11e936a8 (patch)
treee07fe689f2e1fa50d205eb5e984f474007374da4 /src/di_container.rs
parent26667cddb857a21522b49b5ac83228b2a72a353a (diff)
refactor: add back Intertrait tests & Rc support
Diffstat (limited to 'src/di_container.rs')
-rw-r--r--src/di_container.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/di_container.rs b/src/di_container.rs
index 40de948..1f7700f 100644
--- a/src/di_container.rs
+++ b/src/di_container.rs
@@ -9,7 +9,7 @@ use error_stack::{Report, ResultExt};
use crate::castable_factory::CastableFactory;
use crate::errors::di_container::DIContainerError;
use crate::interfaces::injectable::Injectable;
-use crate::libs::intertrait::cast_box::CastBox;
+use crate::libs::intertrait::cast::CastBox;
use crate::provider::{IProvider, InjectableTypeProvider, Providable};
use crate::ptr::InterfacePtr;
@@ -225,7 +225,7 @@ impl DIContainer
match binding_providable {
Providable::Factory(binding_factory) => {
- use crate::libs::intertrait::cast_rc::CastRc;
+ use crate::libs::intertrait::cast::CastRc;
let factory_box_result = binding_factory.cast::<Interface>();
@@ -493,14 +493,14 @@ mod tests
let mut mock_provider = MockProvider::new();
mock_provider.expect_provide().returning(|_| {
- Ok(Providable::Factory(FactoryPtr::new(CastableFactory::new(
- &|users| {
+ Ok(Providable::Factory(crate::ptr::FactoryPtr::new(
+ CastableFactory::new(&|users| {
let user_manager: InterfacePtr<dyn IUserManager> =
InterfacePtr::new(UserManager::new(users));
user_manager
- },
- ))))
+ }),
+ )))
});
di_container