From e906a0fc5922776b8ecd17e3100b24fc44cedf19 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 16 Jul 2022 14:24:00 +0200 Subject: refactor: use common pointer type aliases --- example/src/main.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'example') diff --git a/example/src/main.rs b/example/src/main.rs index 28f29b4..1f4ddb6 100644 --- a/example/src/main.rs +++ b/example/src/main.rs @@ -1,9 +1,7 @@ -use std::rc::Rc; - use syrette::errors::di_container::DIContainerError; -use syrette::factory; use syrette::interfaces::factory::IFactory; -use syrette::{injectable, DIContainer}; +use syrette::ptr::{FactoryPtr, InterfacePtr}; +use syrette::{factory, injectable, DIContainer}; trait IDog { @@ -91,15 +89,19 @@ trait IHuman struct Human { - _dog: Box, - _cat: Box, - _cow_factory: Rc, + _dog: InterfacePtr, + _cat: InterfacePtr, + _cow_factory: FactoryPtr, } #[injectable(IHuman)] impl Human { - fn new(dog: Box, cat: Box, cow_factory: Rc) -> Self + fn new( + dog: InterfacePtr, + cat: InterfacePtr, + cow_factory: FactoryPtr, + ) -> Self { Self { _dog: dog, -- cgit v1.2.3-18-g5258