bitbox02_rust/ui: inline sdcard wrapper
What changed, and why it matters
This commit is a simple internal code cleanup. It moves the logic for handling an SD card prompt from a separate wrapper function directly into the device's user-interface HAL layer. The actual behavior—waiting for the user to insert an SD card or cancel—does not change. There is no visible security fix or vulnerability here.
No security action required. Treat as normal code-maintenance review.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch inlines the workflow::sdcard::sdcard() async wrapper into hal::bitbox02::ui::BitBox02Ui::insert_sdcard(). The match on bitbox02::ui::SdcardResponse is preserved exactly: Inserted maps to Ok(()) and Cancelled maps to Err(sdcard::UserAbort). The wrapper file is reduced to only the UserAbort type definition. No functional change; pure refactoring.
Changed components
src/rust/bitbox02-rust/src/hal/bitbox02/ui.rssrc/rust/bitbox02-rust/src/workflow/sdcard.rsInspect captured patch +4 / −8
diff --git a/src/rust/bitbox02-rust/src/hal/bitbox02/ui.rs b/src/rust/bitbox02-rust/src/hal/bitbox02/ui.rs
index 18eb549..7a62208 100644
--- a/src/rust/bitbox02-rust/src/hal/bitbox02/ui.rs
+++ b/src/rust/bitbox02-rust/src/hal/bitbox02/ui.rs
@@ -66,7 +66,10 @@ impl Ui for BitBox02Ui {
#[inline(always)]
async fn insert_sdcard(&mut self) -> Result<(), sdcard::UserAbort> {
- sdcard::sdcard().await
+ match bitbox02::ui::sdcard().await {
+ bitbox02::ui::SdcardResponse::Inserted => Ok(()),
+ bitbox02::ui::SdcardResponse::Cancelled => Err(sdcard::UserAbort),
+ }
}
#[inline(always)]
diff --git a/src/rust/bitbox02-rust/src/workflow/sdcard.rs b/src/rust/bitbox02-rust/src/workflow/sdcard.rs
index c0b9bbf..fa64f80 100644
--- a/src/rust/bitbox02-rust/src/workflow/sdcard.rs
+++ b/src/rust/bitbox02-rust/src/workflow/sdcard.rs
@@ -1,10 +1,3 @@
// SPDX-License-Identifier: Apache-2.0
pub struct UserAbort;
-
-pub async fn sdcard() -> Result<(), UserAbort> {
- match bitbox02::ui::sdcard().await {
- bitbox02::ui::SdcardResponse::Inserted => Ok(()),
- bitbox02::ui::SdcardResponse::Cancelled => Err(UserAbort),
- }
-}
Why this scored 15/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.