diff options
| author | mo8it <mo8it@proton.me> | 2024-04-09 21:16:27 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-04-09 21:16:27 +0200 |
| commit | 787bec9875ec3e76d5870808cc7299da1d26dea6 (patch) | |
| tree | 79492b65170a6424fc3dd7669b02646cfb976d94 /src/list | |
| parent | f0ce2c1afa21fdaa34aed8f21c1ef4d3c47cebdd (diff) | |
Use exercises as leaked
Diffstat (limited to 'src/list')
| -rw-r--r-- | src/list/state.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/list/state.rs b/src/list/state.rs index 7bfc163..b67c624 100644 --- a/src/list/state.rs +++ b/src/list/state.rs @@ -16,18 +16,18 @@ pub enum Filter { None, } -pub struct UiState<'a> { - pub table: Table<'a>, +pub struct UiState { + pub table: Table<'static>, pub message: String, pub filter: Filter, - exercises: &'a [Exercise], + exercises: &'static [Exercise], progress: u16, selected: usize, table_state: TableState, last_ind: usize, } -impl<'a> UiState<'a> { +impl UiState { pub fn with_updated_rows(mut self, state_file: &StateFile) -> Self { let mut rows_counter: usize = 0; let mut progress: u16 = 0; @@ -79,7 +79,7 @@ impl<'a> UiState<'a> { self } - pub fn new(state_file: &StateFile, exercises: &'a [Exercise]) -> Self { + pub fn new(state_file: &StateFile, exercises: &'static [Exercise]) -> Self { let header = Row::new(["Next", "State", "Name", "Path"]); let max_name_len = exercises |
