Skip to content

Commit af07ee7

Browse files
committed
use mut ref when setting start page for HomeAndSettings
1 parent 4a0f8f2 commit af07ee7

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

ledger_device_sdk/src/nbgl/nbgl_home_and_settings.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub enum PageIndex {
4444
}
4545

4646
/// Used to display the home screen of the application, with an optional glyph,
47-
/// information fields, and settings switches.
47+
/// information fields, and settings switches.
4848
pub struct NbglHomeAndSettings {
4949
app_name: CString,
5050
info_contents: Vec<CString>,
@@ -134,11 +134,8 @@ impl<'a> NbglHomeAndSettings {
134134
}
135135
}
136136

137-
pub fn set_start_page(self, page: PageIndex) -> NbglHomeAndSettings {
138-
NbglHomeAndSettings {
139-
start_page: page,
140-
..self
141-
}
137+
pub fn set_start_page(&mut self, page: PageIndex) {
138+
self.start_page = page;
142139
}
143140

144141
/// Show the home screen and settings page.

0 commit comments

Comments
 (0)