diff options
author | HampusM <hampus@hampusmat.com> | 2023-09-09 13:28:47 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2023-09-09 13:28:47 +0200 |
commit | 736947c869acda30d5af3234bf01f24c8a720c10 (patch) | |
tree | 0dbcf7dcf168640abd0962a5d13627af97b0b010 /src/di_container/blocking/binding/builder.rs | |
parent | 89ac2c1713711a6e1b60d5d2d75989f360141ad7 (diff) |
refactor: remove unnecessary block in the BindingBuilder::to method
Diffstat (limited to 'src/di_container/blocking/binding/builder.rs')
-rw-r--r-- | src/di_container/blocking/binding/builder.rs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/di_container/blocking/binding/builder.rs b/src/di_container/blocking/binding/builder.rs index 577f034..bfc9e4e 100644 --- a/src/di_container/blocking/binding/builder.rs +++ b/src/di_container/blocking/binding/builder.rs @@ -99,16 +99,13 @@ where where Implementation: Injectable<DIContainerType>, { + if self + .di_container + .has_binding::<Interface>(BindingOptions::new()) { - if self - .di_container - .has_binding::<Interface>(BindingOptions::new()) - { - return Err(BindingBuilderError::BindingAlreadyExists(type_name::< - Interface, - >( - ))); - } + return Err(BindingBuilderError::BindingAlreadyExists(type_name::< + Interface, + >())); } let binding_scope_configurator = BindingScopeConfigurator::new( |