From 80fa6c254de6a73d4742e3190d0eb8fad00985ba Mon Sep 17 00:00:00 2001 From: obrusvit Date: Fri, 13 Dec 2024 15:36:24 +0100 Subject: [PATCH] fixup! refactor(core): safe iface for get_glyph_data --- core/embed/rust/src/ui/display/font.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/core/embed/rust/src/ui/display/font.rs b/core/embed/rust/src/ui/display/font.rs index b7e22b0530..1de99b6aef 100644 --- a/core/embed/rust/src/ui/display/font.rs +++ b/core/embed/rust/src/ui/display/font.rs @@ -302,17 +302,15 @@ impl Font { } pub fn text_height(self) -> i16 { - display::get_font_info(self.into()).map_or(i16::MAX, |font| font.height.try_into().unwrap()) + unwrap!(display::get_font_info(self.into()).map(|f| f.height.try_into().unwrap())) } pub fn text_max_height(self) -> i16 { - display::get_font_info(self.into()) - .map_or(i16::MAX, |font| font.max_height.try_into().unwrap()) + unwrap!(display::get_font_info(self.into()).map(|f| f.max_height.try_into().unwrap())) } pub fn text_baseline(self) -> i16 { - display::get_font_info(self.into()) - .map_or(i16::MAX, |font| font.baseline.try_into().unwrap()) + unwrap!(display::get_font_info(self.into()).map(|f| f.baseline.try_into().unwrap())) } pub fn line_height(self) -> i16 {