aboutsummaryrefslogtreecommitdiff
path: root/examples/basic/bootstrap.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/basic/bootstrap.rs')
-rw-r--r--examples/basic/bootstrap.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/basic/bootstrap.rs b/examples/basic/bootstrap.rs
index 71ef713..10a7041 100644
--- a/examples/basic/bootstrap.rs
+++ b/examples/basic/bootstrap.rs
@@ -14,7 +14,10 @@ pub fn bootstrap() -> DIContainer
{
let mut di_container: DIContainer = DIContainer::new();
- di_container.bind::<dyn IDog>().to::<Dog>();
+ di_container
+ .bind::<dyn IDog>()
+ .to_singleton::<Dog>()
+ .unwrap();
di_container.bind::<dyn ICat>().to::<Cat>();
di_container.bind::<dyn IHuman>().to::<Human>();