aboutsummaryrefslogtreecommitdiff
path: root/examples/basic/main.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-08-25 20:21:49 +0200
committerHampusM <hampus@hampusmat.com>2022-08-27 14:28:23 +0200
commit1c46b68581213ca8ae6200daa32f626b5389b4b0 (patch)
tree8da649471db7893a2347a2df383324b84ac226f0 /examples/basic/main.rs
parent8e862c7998d0b59c71d20cbcbbc57031f734b6fa (diff)
refactor!: make DI container have single get function
BREAKING CHANGE: The DI container get_singleton & get_factory functions have been replaced by the get function now returning a enum
Diffstat (limited to 'examples/basic/main.rs')
-rw-r--r--examples/basic/main.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/basic/main.rs b/examples/basic/main.rs
index 72f07c2..dbc9215 100644
--- a/examples/basic/main.rs
+++ b/examples/basic/main.rs
@@ -18,11 +18,11 @@ fn main() -> Result<(), Box<dyn Error>>
let di_container = bootstrap()?;
- let dog = di_container.get_singleton::<dyn IDog>()?;
+ let dog = di_container.get::<dyn IDog>()?.singleton()?;
dog.woof();
- let human = di_container.get::<dyn IHuman>()?;
+ let human = di_container.get::<dyn IHuman>()?.transient()?;
human.make_pets_make_sounds();