From 425b263affdf1a7d5e6e69701f7a872588e80cd6 Mon Sep 17 00:00:00 2001 From: Sourcery AI <> Date: Wed, 11 Oct 2023 12:19:47 +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