From 3fbf26181f1b4b9e594debb103fd347bd93240ea Mon Sep 17 00:00:00 2001 From: HampusM Date: Wed, 27 Jul 2022 15:17:33 +0200 Subject: refactor!: rename InterfacePtr to TransientPtr BREAKING CHANGE: InterfacePtr has been renamed to TransientPtr --- examples/basic/animals/human.rs | 8 ++++---- examples/factory/bootstrap.rs | 6 +++--- examples/factory/main.rs | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'examples') diff --git a/examples/basic/animals/human.rs b/examples/basic/animals/human.rs index 00574a3..8e52b5b 100644 --- a/examples/basic/animals/human.rs +++ b/examples/basic/animals/human.rs @@ -1,5 +1,5 @@ use syrette::injectable; -use syrette::ptr::InterfacePtr; +use syrette::ptr::TransientPtr; use crate::interfaces::cat::ICat; use crate::interfaces::dog::IDog; @@ -7,14 +7,14 @@ use crate::interfaces::human::IHuman; pub struct Human { - dog: InterfacePtr, - cat: InterfacePtr, + dog: TransientPtr, + cat: TransientPtr, } #[injectable(IHuman)] impl Human { - pub fn new(dog: InterfacePtr, cat: InterfacePtr) -> Self + pub fn new(dog: TransientPtr, cat: TransientPtr) -> Self { Self { dog, cat } } diff --git a/examples/factory/bootstrap.rs b/examples/factory/bootstrap.rs index 5086b1a..1967c6a 100644 --- a/examples/factory/bootstrap.rs +++ b/examples/factory/bootstrap.rs @@ -1,4 +1,4 @@ -use syrette::ptr::InterfacePtr; +use syrette::ptr::TransientPtr; use syrette::DIContainer; // Interfaces @@ -14,8 +14,8 @@ pub fn bootstrap() -> DIContainer di_container .bind::() .to_factory(&|name, date_of_birth, password| { - let user: InterfacePtr = - InterfacePtr::new(User::new(name, date_of_birth, password)); + let user: TransientPtr = + TransientPtr::new(User::new(name, date_of_birth, password)); user }); diff --git a/examples/factory/main.rs b/examples/factory/main.rs index c659f3e..e2e80f1 100644 --- a/examples/factory/main.rs +++ b/examples/factory/main.rs @@ -10,10 +10,10 @@ use bootstrap::bootstrap; use interfaces::user::IUser; use interfaces::user::IUserFactory; use syrette::ptr::FactoryPtr; -use syrette::ptr::InterfacePtr; +use syrette::ptr::TransientPtr; fn add_users( - users: &mut Vec>, + users: &mut Vec>, user_factory: &FactoryPtr, ) { @@ -30,7 +30,7 @@ fn main() let user_factory = di_container.get_factory::().unwrap(); - let mut users = Vec::>::new(); + let mut users = Vec::>::new(); add_users(&mut users, &user_factory); -- cgit v1.2.3-18-g5258