chore(core/rust): use `deref()` instead of `deref_mut()`
What changed, and why it matters
This is a one-line code cleanup in the user-interface code for a Trezor hardware wallet screen. It changes a mutable borrow (`deref_mut`) to an immutable borrow (`deref`) where the code only reads a value. This is a routine Rust style/refactor change with no visible security effect.
No security action needed. Treat as normal code-quality maintenance.
Security signals we found
No security-relevant keywords in commit title or message
Change is a single borrow mutability reduction with no functional change
No changelog entry requested by author
No incident, CVE, advisory, or security disclosure referenced
Evidence from the diff
In core/embed/rust/src/ui/layout_eckhart/firmware/device_menu_screen.rs, the match expression that inspects self.active_screen was using deref_mut(). Since the match arms only read the enum variant and its contained id, an immutable deref() is sufficient. The change removes unnecessary mutability and may silence a compiler warning or satisfy clippy, but it does not alter program behavior or fix a memory-safety bug.
Changed components
core/embed/rust/src/ui/layout_eckhart/firmware/device_menu_screen.rsInspect captured patch +1 / −1
diff --git a/core/embed/rust/src/ui/layout_eckhart/firmware/device_menu_screen.rs b/core/embed/rust/src/ui/layout_eckhart/firmware/device_menu_screen.rs
index 0d5826ec..15f2adef 100644
--- a/core/embed/rust/src/ui/layout_eckhart/firmware/device_menu_screen.rs
+++ b/core/embed/rust/src/ui/layout_eckhart/firmware/device_menu_screen.rs
@@ -1042,7 +1042,7 @@ impl Component for DeviceMenuScreen {
_ => false,
};
if refresh {
- let submenu_idx = match self.active_screen.deref_mut() {
+ let submenu_idx = match self.active_screen.deref() {
ActiveScreen::Menu(_, id) => *id,
ActiveScreen::Device(_) => DeviceMenuId::PairAndConnect,
ActiveScreen::Regulatory(_) | ActiveScreen::About(_) => DeviceMenuId::Device,
Why this scored 12/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.