fix: get rid of warning in non-debug build
What changed, and why it matters
This is a minor Rust code cleanup that removes a compiler warning in non-debug builds. The change splits one function into two versions: one for debug builds that sets a test-only flag, and one for release builds that does nothing. There is no security-relevant change to actual device behavior.
No security action required. Treat as normal code-quality maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit refactors with_flow_menu() in the Eckhart UI text screen. Previously the function took mut self and conditionally set has_flow_menu only under #[cfg(feature = "ui_debug")], causing an unused-mut warning in non-debug builds. The patch creates two cfg-gated implementations: #[cfg(feature = "ui_debug")] keeps the mutable version that sets the flag, while #[cfg(not(feature = "ui_debug"))] provides an immutable no-op version. The runtime behavior is unchanged.
Changed components
core/embed/rust/src/ui/layout_eckhart/firmware/text_screen.rsInspect captured patch +6 / −4
diff --git a/core/embed/rust/src/ui/layout_eckhart/firmware/text_screen.rs b/core/embed/rust/src/ui/layout_eckhart/firmware/text_screen.rs
index 6180c6d3..dbac7316 100644
--- a/core/embed/rust/src/ui/layout_eckhart/firmware/text_screen.rs
+++ b/core/embed/rust/src/ui/layout_eckhart/firmware/text_screen.rs
@@ -116,12 +116,14 @@ where
// which are implemented as part of swipe flows.
// Once we have eventually replaced all these with new style "external menu",
// we should get rid of this flag and the related debuglink code.
+ #[cfg(feature = "ui_debug")]
pub fn with_flow_menu(mut self) -> Self {
// Allow visiting this menu automatically by tests
- #[cfg(feature = "ui_debug")]
- {
- self.has_flow_menu = true;
- }
+ self.has_flow_menu = true;
+ self
+ }
+ #[cfg(not(feature = "ui_debug"))]
+ pub fn with_flow_menu(self) -> Self {
self
}
Why this scored 13/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.