util/futures: drop UI completion names
What changed, and why it matters
This commit is a simple internal code cleanup. It renames two Rust types from 'UiResponder' and 'UiResult' to the shorter 'Responder' and 'Result', and updates the files that use those names. There is no change to what the code does, no bug fix, and no security improvement or regression visible in the diff.
No security action needed. Treat as a normal maintainability/refactoring change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch is a pure refactor in the Rust futures completion helper under src/rust/util/src/futures/completion.rs. It removes the ‘Ui’ prefix from UiResponder/UiResult and updates call sites in src/rust/bitbox03/src/ui.rs and src/rust/bitbox03/src/ui/confirm.rs. Function signatures, behavior, ownership, and the underlying SharedState/Rc/RefCell/waker mechanism are unchanged. The new ‘Result’ type is a local struct, not std::result::Result, so it does not alter type semantics.
Changed components
src/rust/util/src/futures/completion.rssrc/rust/bitbox03/src/ui.rssrc/rust/bitbox03/src/ui/confirm.rsInspect captured patch +11 / −11
diff --git a/src/rust/bitbox03/src/ui.rs b/src/rust/bitbox03/src/ui.rs
index 24a653f..48ddbf3 100644
--- a/src/rust/bitbox03/src/ui.rs
+++ b/src/rust/bitbox03/src/ui.rs
@@ -249,7 +249,7 @@ impl BitBox03Ui {
async fn with_result_screen<T, F>(&mut self, build_screen: F) -> T
where
- F: FnOnce(completion::UiResponder<T>) -> LvObj,
+ F: FnOnce(completion::Responder<T>) -> LvObj,
{
let (responder, result) = completion::completion();
let screen = build_screen(responder);
diff --git a/src/rust/bitbox03/src/ui/confirm.rs b/src/rust/bitbox03/src/ui/confirm.rs
index ec29ae9..e6dc341 100644
--- a/src/rust/bitbox03/src/ui/confirm.rs
+++ b/src/rust/bitbox03/src/ui/confirm.rs
@@ -5,11 +5,11 @@ use bitbox_lvgl::{
self as lvgl, LabelExt, LvAlign, LvButton, LvLabel, LvLabelLongMode, LvObj, LvOpacityLevel,
ObjExt,
};
-use util::futures::completion::UiResponder;
+use util::futures::completion::Responder;
pub(super) fn build_confirm_screen(
params: &ConfirmParams<'_>,
- responder: UiResponder<Result<(), UserAbort>>,
+ responder: Responder<Result<(), UserAbort>>,
) -> LvObj {
let screen = LvObj::new().unwrap();
screen.set_layout(lvgl::LvLayout::LV_LAYOUT_FLEX);
diff --git a/src/rust/util/src/futures/completion.rs b/src/rust/util/src/futures/completion.rs
index b136796..a79de5c 100644
--- a/src/rust/util/src/futures/completion.rs
+++ b/src/rust/util/src/futures/completion.rs
@@ -11,28 +11,28 @@ struct SharedState<T> {
result: Option<T>,
}
-pub struct UiResponder<T> {
+pub struct Responder<T> {
shared_state: Rc<RefCell<SharedState<T>>>,
}
-pub struct UiResult<T> {
+pub struct Result<T> {
shared_state: Rc<RefCell<SharedState<T>>>,
}
-pub fn completion<T>() -> (UiResponder<T>, UiResult<T>) {
+pub fn completion<T>() -> (Responder<T>, Result<T>) {
let shared_state = Rc::new(RefCell::new(SharedState {
waker: None,
result: None,
}));
(
- UiResponder {
+ Responder {
shared_state: Rc::clone(&shared_state),
},
- UiResult { shared_state },
+ Result { shared_state },
)
}
-impl<T> UiResponder<T> {
+impl<T> Responder<T> {
pub fn resolve(&self, value: T) {
let mut shared_state = self.shared_state.borrow_mut();
if shared_state.result.is_none() {
@@ -44,7 +44,7 @@ impl<T> UiResponder<T> {
}
}
-impl<T> Clone for UiResponder<T> {
+impl<T> Clone for Responder<T> {
fn clone(&self) -> Self {
Self {
shared_state: Rc::clone(&self.shared_state),
@@ -52,7 +52,7 @@ impl<T> Clone for UiResponder<T> {
}
}
-impl<T> Future for UiResult<T> {
+impl<T> Future for Result<T> {
type Output = T;
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
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.