diff options
| author | mo8it <mo8it@proton.me> | 2024-04-14 01:15:43 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-04-14 01:15:43 +0200 |
| commit | 5c0073a9485c4226e58b657cb49628919a28a942 (patch) | |
| tree | 00cd8cb2ca8926e5e6cf68e44d51d14f77cc4695 /src/list.rs | |
| parent | 2a26dfcb005d2a9ee24e920462b37dfb6d235c32 (diff) | |
Tolerate changes in the state file
Diffstat (limited to 'src/list.rs')
| -rw-r--r-- | src/list.rs | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/list.rs b/src/list.rs index de120ea..2bb813d 100644 --- a/src/list.rs +++ b/src/list.rs @@ -5,7 +5,7 @@ use crossterm::{ ExecutableCommand, }; use ratatui::{backend::CrosstermBackend, Terminal}; -use std::{fmt::Write, io}; +use std::io; mod state; @@ -72,14 +72,7 @@ pub fn list(app_state: &mut AppState) -> Result<()> { ui_state.message.push_str(message); } KeyCode::Char('r') => { - let Some(exercise) = ui_state.reset_selected()? else { - continue; - }; - - ui_state = ui_state.with_updated_rows(); - ui_state - .message - .write_fmt(format_args!("The exercise {exercise} has been reset!"))?; + ui_state = ui_state.with_reset_selected()?; } KeyCode::Char('c') => { ui_state.selected_to_current_exercise()?; |
