From f75a7d58135825c4f9094c1e10f36de4a952f455 Mon Sep 17 00:00:00 2001 From: HampusM Date: Wed, 27 Jul 2022 19:10:30 +0200 Subject: feat: add injecting singletons into constructors --- examples/basic/animals/human.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/basic/animals') diff --git a/examples/basic/animals/human.rs b/examples/basic/animals/human.rs index 8e52b5b..d9b848b 100644 --- a/examples/basic/animals/human.rs +++ b/examples/basic/animals/human.rs @@ -1,5 +1,5 @@ use syrette::injectable; -use syrette::ptr::TransientPtr; +use syrette::ptr::{SingletonPtr, TransientPtr}; use crate::interfaces::cat::ICat; use crate::interfaces::dog::IDog; @@ -7,14 +7,14 @@ use crate::interfaces::human::IHuman; pub struct Human { - dog: TransientPtr, + dog: SingletonPtr, cat: TransientPtr, } #[injectable(IHuman)] impl Human { - pub fn new(dog: TransientPtr, cat: TransientPtr) -> Self + pub fn new(dog: SingletonPtr, cat: TransientPtr) -> Self { Self { dog, cat } } -- cgit v1.2.3-18-g5258