aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-08-03 14:13:55 +0200
committerHampusM <hampus@hampusmat.com>2022-08-21 18:17:17 +0200
commitb54dee1fb52f259de8b485d050d75c6956750b7f (patch)
treec2aa02de55da6c2d4c338982afee18ce42465160 /src/lib.rs
parentc33cf02c9a6fffc6149fd7b59c63ad0d15d61432 (diff)
feat!: prevent binding the same interface more than once
BREAKING CHANGE: The 'to' and 'to_factory' methods of BindingBuilder now return 'Result'
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index a03675b..89688f1 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -40,7 +40,7 @@ mod provider;
#[macro_export]
macro_rules! di_container_bind {
($interface: path => $implementation: ty, $di_container: ident) => {
- $di_container.bind::<dyn $interface>().to::<$implementation>();
+ $di_container.bind::<dyn $interface>().to::<$implementation>().unwrap();
syrette::declare_interface!($implementation -> $interface);
};