From 4cc6413a4661414ef5bf40a12738335feb10974c Mon Sep 17 00:00:00 2001 From: tychovrahe Date: Fri, 23 Jun 2023 15:20:01 +0200 Subject: [PATCH] chore(core/rust): fix compilation warnings [no changelog] --- core/embed/rust/src/ui/display/toif.rs | 4 ++-- core/embed/rust/src/ui/macros.rs | 1 + core/embed/rust/src/ui/model_tt/component/welcome_screen.rs | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/embed/rust/src/ui/display/toif.rs b/core/embed/rust/src/ui/display/toif.rs index 677c3d37b4..e2b06a5699 100644 --- a/core/embed/rust/src/ui/display/toif.rs +++ b/core/embed/rust/src/ui/display/toif.rs @@ -269,10 +269,10 @@ impl Icon { /// Create a named icon. /// The name is only stored in debug builds. - pub const fn debug_named(data: &'static [u8], name: &'static str) -> Self { + pub const fn debug_named(data: &'static [u8], _name: &'static str) -> Self { Self { #[cfg(feature = "ui_debug")] - name, + name: _name, ..Self::new(data) } } diff --git a/core/embed/rust/src/ui/macros.rs b/core/embed/rust/src/ui/macros.rs index 50398399a5..fb5d10a804 100644 --- a/core/embed/rust/src/ui/macros.rs +++ b/core/embed/rust/src/ui/macros.rs @@ -17,6 +17,7 @@ macro_rules! build_string { } /// Transforms integer into string slice. For example for printing. +#[allow(unused_macros)] // not used in TT UI macro_rules! inttostr { ($int:expr) => {{ heapless::String::<10>::from($int).as_str() diff --git a/core/embed/rust/src/ui/model_tt/component/welcome_screen.rs b/core/embed/rust/src/ui/model_tt/component/welcome_screen.rs index 0566166534..ea621d8c5e 100644 --- a/core/embed/rust/src/ui/model_tt/component/welcome_screen.rs +++ b/core/embed/rust/src/ui/model_tt/component/welcome_screen.rs @@ -1,6 +1,5 @@ use crate::ui::{ component::{Component, Event, EventCtx, Never}, - constant::MODEL_NAME, geometry::{Alignment2D, Offset, Rect}, model_tt::theme, }; @@ -12,7 +11,7 @@ const ICON_TOP_MARGIN: i16 = 48; #[cfg(not(feature = "bootloader"))] const MODEL_NAME_FONT: display::Font = display::Font::DEMIBOLD; #[cfg(not(feature = "bootloader"))] -use crate::ui::display; +use crate::ui::{constant::MODEL_NAME, display}; pub struct WelcomeScreen { area: Rect, @@ -65,6 +64,7 @@ impl Component for WelcomeScreen { impl crate::trace::Trace for WelcomeScreen { fn trace(&self, t: &mut dyn crate::trace::Tracer) { t.component("WelcomeScreen"); + #[cfg(not(feature = "bootloader"))] t.string("model", MODEL_NAME); } }