Skip to content

Commit

Permalink
use mut ref when setting start page for HomeAndSettings
Browse files Browse the repository at this point in the history
  • Loading branch information
yogh333 committed Oct 24, 2024
1 parent 4a0f8f2 commit af07ee7
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions ledger_device_sdk/src/nbgl/nbgl_home_and_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub enum PageIndex {
}

/// Used to display the home screen of the application, with an optional glyph,
/// information fields, and settings switches.
/// information fields, and settings switches.
pub struct NbglHomeAndSettings {
app_name: CString,
info_contents: Vec<CString>,
Expand Down Expand Up @@ -134,11 +134,8 @@ impl<'a> NbglHomeAndSettings {
}
}

pub fn set_start_page(self, page: PageIndex) -> NbglHomeAndSettings {
NbglHomeAndSettings {
start_page: page,
..self
}
pub fn set_start_page(&mut self, page: PageIndex) {
self.start_page = page;
}

/// Show the home screen and settings page.
Expand Down

0 comments on commit af07ee7

Please sign in to comment.