Skip to content

Commit 1e96d5d

Browse files
committed
Remove mut when using show() for sync Nbgl object
1 parent e353f7d commit 1e96d5d

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

ledger_device_sdk/src/nbgl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ trait SyncNBGL: Sized {
7777
}
7878
}
7979

80-
fn ux_sync_wait(&mut self, exit_on_apdu: bool) -> SyncNbgl {
80+
fn ux_sync_wait(&self, exit_on_apdu: bool) -> SyncNbgl {
8181
unsafe {
8282
if let Some(comm) = COMM_REF.as_mut() {
8383
while !G_ENDED {

ledger_device_sdk/src/nbgl/nbgl_address_review.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl<'a> NbglAddressReview<'a> {
3131
}
3232
}
3333

34-
pub fn show(&mut self, address: &str) -> bool {
34+
pub fn show(&self, address: &str) -> bool {
3535
unsafe {
3636
let icon: nbgl_icon_details_t = match self.glyph {
3737
Some(g) => g.into(),

ledger_device_sdk/src/nbgl/nbgl_choice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ impl<'a> NbglChoice<'a> {
2222
}
2323

2424
pub fn show(
25-
&mut self,
25+
&self,
2626
message: &str,
2727
sub_message: &str,
2828
confirm_text: &str,

ledger_device_sdk/src/nbgl/nbgl_generic_review.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ impl InfoButton {
111111
/// using the NbglGenericReview struct.
112112
pub struct TagValueList {
113113
pairs: Vec<nbgl_contentTagValue_t>,
114-
items: Vec<CString>,
115-
values: Vec<CString>,
114+
_items: Vec<CString>,
115+
_values: Vec<CString>,
116116
nb_max_lines_for_value: u8,
117117
small_case_for_value: bool,
118118
wrapping: bool,
@@ -142,8 +142,8 @@ impl TagValueList {
142142
}
143143
TagValueList {
144144
pairs: c_field_strings,
145-
items: c_field_names,
146-
values: c_field_values,
145+
_items: c_field_names,
146+
_values: c_field_values,
147147
nb_max_lines_for_value,
148148
small_case_for_value,
149149
wrapping,
@@ -199,7 +199,7 @@ impl TagValueConfirm {
199199
/// when using the NbglGenericReview struct.
200200
pub struct InfosList {
201201
info_types_cstrings: Vec<CString>,
202-
info_contents_cstrings: Vec<CString>,
202+
_info_contents_cstrings: Vec<CString>,
203203
info_types_ptr: Vec<*const c_char>,
204204
info_contents_ptr: Vec<*const c_char>,
205205
}
@@ -220,7 +220,7 @@ impl InfosList {
220220
info_contents_cstrings.iter().map(|s| s.as_ptr()).collect();
221221
InfosList {
222222
info_types_cstrings: info_types_cstrings,
223-
info_contents_cstrings: info_contents_cstrings,
223+
_info_contents_cstrings: info_contents_cstrings,
224224
info_types_ptr: info_types_ptr,
225225
info_contents_ptr: info_contents_ptr,
226226
}
@@ -413,7 +413,7 @@ impl NbglGenericReview {
413413
.collect()
414414
}
415415

416-
pub fn show(&mut self, reject_button_str: &str) -> bool {
416+
pub fn show(&self, reject_button_str: &str) -> bool {
417417
unsafe {
418418
let c_content_list: Vec<nbgl_content_t> = self.to_c_content_list();
419419

ledger_device_sdk/src/nbgl/nbgl_review.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl<'a> NbglReview<'a> {
5757
}
5858
}
5959

60-
pub fn show(&mut self, fields: &[Field]) -> bool {
60+
pub fn show(&self, fields: &[Field]) -> bool {
6161
unsafe {
6262
let v: Vec<CField> = fields
6363
.iter()

ledger_device_sdk/src/nbgl/nbgl_review_status.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ impl<'a> NbglReviewStatus {
1919
NbglReviewStatus { status_type }
2020
}
2121

22-
pub fn show(&mut self, success: bool) {
22+
pub fn show(&self, success: bool) {
2323
unsafe {
2424
self.ux_sync_init();
2525
nbgl_useCaseReviewStatus(self.status_type.to_message(success), Some(quit_callback));

ledger_device_sdk/src/nbgl/nbgl_status.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ impl NbglStatus {
2121
}
2222
}
2323

24-
pub fn show(&mut self, success: bool) {
24+
pub fn show(&self, success: bool) {
2525
unsafe {
2626
self.ux_sync_init();
2727
nbgl_useCaseStatus(

ledger_device_sdk/src/nbgl/nbgl_streaming_review.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl NbglStreamingReview {
3737
}
3838
}
3939

40-
pub fn start(&mut self, title: &str, subtitle: &str) -> bool {
40+
pub fn start(&self, title: &str, subtitle: &str) -> bool {
4141
unsafe {
4242
let title = CString::new(title).unwrap();
4343
let subtitle = CString::new(subtitle).unwrap();
@@ -77,7 +77,7 @@ impl NbglStreamingReview {
7777
}
7878
}
7979

80-
pub fn continue_review(&mut self, fields: &[Field]) -> bool {
80+
pub fn continue_review(&self, fields: &[Field]) -> bool {
8181
unsafe {
8282
let v: Vec<CField> = fields
8383
.iter()
@@ -124,7 +124,7 @@ impl NbglStreamingReview {
124124
}
125125
}
126126

127-
pub fn finish(&mut self, finish_title: &str) -> bool {
127+
pub fn finish(&self, finish_title: &str) -> bool {
128128
unsafe {
129129
let finish_title = CString::new(finish_title).unwrap();
130130

0 commit comments

Comments
 (0)