From b54dee1fb52f259de8b485d050d75c6956750b7f Mon Sep 17 00:00:00 2001 From: HampusM Date: Wed, 3 Aug 2022 14:13:55 +0200 Subject: feat!: prevent binding the same interface more than once BREAKING CHANGE: The 'to' and 'to_factory' methods of BindingBuilder now return 'Result' --- examples/basic/bootstrap.rs | 4 ++-- examples/factory/bootstrap.rs | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'examples') diff --git a/examples/basic/bootstrap.rs b/examples/basic/bootstrap.rs index 10a7041..4af2d82 100644 --- a/examples/basic/bootstrap.rs +++ b/examples/basic/bootstrap.rs @@ -18,8 +18,8 @@ pub fn bootstrap() -> DIContainer .bind::() .to_singleton::() .unwrap(); - di_container.bind::().to::(); - di_container.bind::().to::(); + di_container.bind::().to::().unwrap(); + di_container.bind::().to::().unwrap(); di_container } diff --git a/examples/factory/bootstrap.rs b/examples/factory/bootstrap.rs index 1967c6a..a44ccfb 100644 --- a/examples/factory/bootstrap.rs +++ b/examples/factory/bootstrap.rs @@ -18,7 +18,8 @@ pub fn bootstrap() -> DIContainer TransientPtr::new(User::new(name, date_of_birth, password)); user - }); + }) + .unwrap(); di_container } -- cgit v1.2.3-18-g5258