From 520380c0bdada8ae43b251acca305dec7e4b9971 Mon Sep 17 00:00:00 2001 From: Sourcery AI <> Date: Wed, 11 Oct 2023 11:43:41 +0000 Subject: [PATCH] 'Refactored by Sourcery' --- findmyorder/main.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/findmyorder/main.py b/findmyorder/main.py index e3678009..74d4a74a 100644 --- a/findmyorder/main.py +++ b/findmyorder/main.py @@ -146,12 +146,8 @@ async def identify_order( """ try: - matched_grammar_class = identify_grammar(my_string) - - if matched_grammar_class: - order = matched_grammar_class.define_grammar(my_string) - return order - + if matched_grammar_class := identify_grammar(my_string): + return matched_grammar_class.define_grammar(my_string) except Exception as error: logger.error(error) return error