From d2f67d48fa6e638c87e1562a8ab2d4ef5ec13d27 Mon Sep 17 00:00:00 2001 From: grdddj Date: Tue, 5 Sep 2023 11:44:25 +0200 Subject: [PATCH] chore(core/rust): transform if-elif into match [no changelog] --- core/embed/rust/src/ui/model_tr/component/button.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/core/embed/rust/src/ui/model_tr/component/button.rs b/core/embed/rust/src/ui/model_tr/component/button.rs index 1435eb1f6d..1746ccf7de 100644 --- a/core/embed/rust/src/ui/model_tr/component/button.rs +++ b/core/embed/rust/src/ui/model_tr/component/button.rs @@ -381,14 +381,11 @@ where /// Resolves text and finds possible icon names. pub fn from_text_possible_icon(text: T) -> Self { - if text.as_ref() == "" { - Self::cancel_icon() - } else if text.as_ref() == "<" { - Self::left_arrow_icon() - } else if text.as_ref() == "^" { - Self::up_arrow_icon() - } else { - Self::text(text) + match text.as_ref() { + "" => Self::cancel_icon(), + "<" => Self::left_arrow_icon(), + "^" => Self::up_arrow_icon(), + _ => Self::text(text), } }