1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-22 14:28:07 +00:00

chore(core/rust): transform if-elif into match

[no changelog]
This commit is contained in:
grdddj 2023-09-05 11:44:25 +02:00 committed by Jiří Musil
parent 66616bbf67
commit d2f67d48fa

View File

@ -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),
}
}