diff --git a/core/embed/rust/src/ui/display/toif.rs b/core/embed/rust/src/ui/display/toif.rs index 89a40a2eb9..1a605e18af 100644 --- a/core/embed/rust/src/ui/display/toif.rs +++ b/core/embed/rust/src/ui/display/toif.rs @@ -11,7 +11,6 @@ use crate::{ geometry::{Alignment2D, Offset, Point, Rect}, }, }; -use core::cmp::max; #[cfg(feature = "dma2d")] use crate::{ @@ -27,6 +26,8 @@ use crate::ui::display::{get_color_table, pixeldata}; #[cfg(feature = "framebuffer")] use crate::trezorhal::{buffers::BufferLine4bpp, dma2d::dma2d_setup_4bpp}; +#[cfg(feature = "framebuffer")] +use core::cmp::max; use super::Color; diff --git a/core/embed/rust/src/ui/model_tr/component/input_methods/pin.rs b/core/embed/rust/src/ui/model_tr/component/input_methods/pin.rs index 722345e354..80b9c7c61f 100644 --- a/core/embed/rust/src/ui/model_tr/component/input_methods/pin.rs +++ b/core/embed/rust/src/ui/model_tr/component/input_methods/pin.rs @@ -35,7 +35,7 @@ const CHOICES: [(&str, PinAction, Option, bool, bool); CHOICE_LENGTH] = [ "inputs__delete", PinAction::Delete, Some(theme::ICON_DELETE), - true, + true, // without_release true, ), ( diff --git a/core/embed/rust/src/ui/model_tt/layout.rs b/core/embed/rust/src/ui/model_tt/layout.rs index ee6a8797b9..39f7a81a07 100644 --- a/core/embed/rust/src/ui/model_tt/layout.rs +++ b/core/embed/rust/src/ui/model_tt/layout.rs @@ -32,7 +32,7 @@ use crate::{ }, Border, Component, Empty, FormattedText, Label, Never, Qr, Timeout, }, - display::{self, tjpgd::jpeg_info}, + display::tjpgd::jpeg_info, geometry, layout::{ obj::{ComponentMsgObj, LayoutObj}, @@ -51,9 +51,9 @@ use super::{ FidoMsg, Frame, FrameMsg, Homescreen, HomescreenMsg, IconDialog, Lockscreen, MnemonicInput, MnemonicKeyboard, MnemonicKeyboardMsg, NumberInputDialog, NumberInputDialogMsg, PassphraseKeyboard, PassphraseKeyboardMsg, PinKeyboard, PinKeyboardMsg, Progress, - SelectWordCount, SelectWordCountMsg, SelectWordMsg, SimplePage, Slip39Input, WelcomeScreen, + SelectWordCount, SelectWordCountMsg, SelectWordMsg, SimplePage, Slip39Input, }, - constant, theme, + theme, }; impl TryFrom for Obj { diff --git a/core/embed/rust/src/ui/translations/mod.rs b/core/embed/rust/src/ui/translations/mod.rs index 0ac3574338..9f5bc69e69 100644 --- a/core/embed/rust/src/ui/translations/mod.rs +++ b/core/embed/rust/src/ui/translations/mod.rs @@ -244,6 +244,8 @@ fn are_there_translations() -> bool { /// Returns the translation at the given index. fn get_translation_by_index(index: usize) -> Option<&'static str> { + // TODO: do not use unwrap, probably return None in case of Err? + // --- not to introduce panic in case of corrupted data in flash let header = unwrap!(TranslationsHeader::from_flash()); let translations_table = header.get_translations_table(); @@ -319,6 +321,7 @@ pub struct OffsetLen { /// Information about specific font - where it starts and how long it is fn get_font_offset_from_id(font_id: u16) -> Option { + // TODO: do not use unwrap? let font_table = unwrap!(TranslationsHeader::from_flash()).get_font_table(); match_first_u16_pair( font_id, @@ -359,6 +362,7 @@ fn match_first_u16_pair( // Get information about a given glyph with a given font-offset fn get_glyph_data(char_code: u16, font_offset: u16, font_len: u16) -> Option { + // TODO: do not use unwrap? let font_data = unwrap!(TranslationsHeader::from_flash()).get_font_data_offset(font_offset, font_len); let data_size = font_data.len() as u16; @@ -386,6 +390,7 @@ fn get_glyph_font_data(char_code: u16, font_id: u16) -> Option { if let Some(font_offset) = get_font_offset_from_id(font_id) { if let Some(glyph_data) = get_glyph_data(char_code, font_offset.offset, font_offset.len) { + // TODO: do not use unwrap? let font_start_offset = unwrap!(TranslationsHeader::from_flash()).font_start_offset(); let final_offset = font_start_offset + font_offset.offset + glyph_data.offset; return Some(OffsetLen {