diff options
author | HampusM <hampus@hampusmat.com> | 2022-07-27 15:17:33 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-07-31 12:15:18 +0200 |
commit | 3fbf26181f1b4b9e594debb103fd347bd93240ea (patch) | |
tree | 63cf13edb5ea21a6cbbcfcf474611820382a5048 /examples/factory | |
parent | 224e59112e65ce6cbafe5a87dba031dd11e936a8 (diff) |
refactor!: rename InterfacePtr to TransientPtr
BREAKING CHANGE: InterfacePtr has been renamed to TransientPtr
Diffstat (limited to 'examples/factory')
-rw-r--r-- | examples/factory/bootstrap.rs | 6 | ||||
-rw-r--r-- | examples/factory/main.rs | 6 |
2 files changed, 6 insertions, 6 deletions
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::<IUserFactory>() .to_factory(&|name, date_of_birth, password| { - let user: InterfacePtr<dyn IUser> = - InterfacePtr::new(User::new(name, date_of_birth, password)); + let user: TransientPtr<dyn IUser> = + 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<InterfacePtr<dyn IUser>>, + users: &mut Vec<TransientPtr<dyn IUser>>, user_factory: &FactoryPtr<IUserFactory>, ) { @@ -30,7 +30,7 @@ fn main() let user_factory = di_container.get_factory::<IUserFactory>().unwrap(); - let mut users = Vec::<InterfacePtr<dyn IUser>>::new(); + let mut users = Vec::<TransientPtr<dyn IUser>>::new(); add_users(&mut users, &user_factory); |