From d65b4f0e869a02006084f34f8ca7cebbb7c80202 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ioan=20Biz=C4=83u?= Date: Tue, 3 Jun 2025 12:41:52 +0200 Subject: [PATCH] fix(core): warnings in device build [no changelog] --- core/embed/rust/src/ui/component/text/layout.rs | 4 ++-- core/embed/rust/src/ui/flow/swipe.rs | 3 +++ core/embed/rust/src/ui/layout/obj.rs | 6 +++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/core/embed/rust/src/ui/component/text/layout.rs b/core/embed/rust/src/ui/component/text/layout.rs index 8248416830..e1b0798f4f 100644 --- a/core/embed/rust/src/ui/component/text/layout.rs +++ b/core/embed/rust/src/ui/component/text/layout.rs @@ -247,7 +247,7 @@ impl TextLayout { text: &str, target: &mut impl Renderer<'s>, alpha: u8, - must_fit: bool, + _must_fit: bool, ) -> LayoutFit { let fit = self.layout_text( text, @@ -256,7 +256,7 @@ impl TextLayout { ); #[cfg(feature = "ui_debug")] - if must_fit && matches!(fit, LayoutFit::OutOfBounds { .. }) { + if _must_fit && matches!(fit, LayoutFit::OutOfBounds { .. }) { target.raise_overflow_exception(); } diff --git a/core/embed/rust/src/ui/flow/swipe.rs b/core/embed/rust/src/ui/flow/swipe.rs index d2ab320746..ded53ac25c 100644 --- a/core/embed/rust/src/ui/flow/swipe.rs +++ b/core/embed/rust/src/ui/flow/swipe.rs @@ -314,7 +314,10 @@ impl Layout> for SwipeFlow { } fn paint(&mut self) -> Result<(), Error> { + #[cfg(feature = "ui_debug")] let mut overflow: bool = false; + #[cfg(not(feature = "ui_debug"))] + let overflow: bool = false; render_on_display(None, Some(Color::black()), |target| { self.render_state(self.state.index(), target); #[cfg(feature = "ui_debug")] diff --git a/core/embed/rust/src/ui/layout/obj.rs b/core/embed/rust/src/ui/layout/obj.rs index d7ca09eb02..f5cf74a823 100644 --- a/core/embed/rust/src/ui/layout/obj.rs +++ b/core/embed/rust/src/ui/layout/obj.rs @@ -44,11 +44,14 @@ use crate::{ }, display::{self, Color}, event::USBEvent, - shape::{render_on_display, Renderer}, + shape::render_on_display, CommonUI, ModelUI, }, }; +#[cfg(feature = "ui_debug")] +use crate::ui::shape::Renderer; + impl AttachType { fn to_obj(self) -> Obj { match self { @@ -147,6 +150,7 @@ where } fn paint(&mut self) -> Result<(), Error> { + #[cfg(feature = "ui_debug")] let mut overflow: bool = false; render_on_display(None, Some(Color::black()), |target| { self.inner.render(target);