From 736947c869acda30d5af3234bf01f24c8a720c10 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 9 Sep 2023 13:28:47 +0200 Subject: refactor: remove unnecessary block in the BindingBuilder::to method --- src/di_container/blocking/binding/builder.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/di_container/blocking') 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, { + if self + .di_container + .has_binding::(BindingOptions::new()) { - if self - .di_container - .has_binding::(BindingOptions::new()) - { - return Err(BindingBuilderError::BindingAlreadyExists(type_name::< - Interface, - >( - ))); - } + return Err(BindingBuilderError::BindingAlreadyExists(type_name::< + Interface, + >())); } let binding_scope_configurator = BindingScopeConfigurator::new( -- cgit v1.2.3-18-g5258