diff options
| author | mo8it <mo8it@proton.me> | 2024-09-04 01:07:08 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-09-04 01:07:08 +0200 |
| commit | 03baa471d94f9dfe7575b985e227df1d4e7803d4 (patch) | |
| tree | 2b9fac685f5a7322e23a49588b87204dfab5042a | |
| parent | da8b3d143a5b7462baf912c58cc768f7cd210ab2 (diff) | |
Simplify handling `p` in list
| -rw-r--r-- | src/list.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/list.rs b/src/list.rs index 5e30384..cfd3720 100644 --- a/src/list.rs +++ b/src/list.rs @@ -72,15 +72,15 @@ fn handle_list(app_state: &mut AppState, stdout: &mut StdoutLock) -> Result<()> } } KeyCode::Char('p') => { - let message = if list_state.filter() == Filter::Pending { + if list_state.filter() == Filter::Pending { list_state.set_filter(Filter::None); - "Disabled filter PENDING" + list_state.message.push_str("Disabled filter PENDING"); } else { list_state.set_filter(Filter::Pending); - "Enabled filter PENDING │ Press p again to disable the filter" - }; - - list_state.message.push_str(message); + list_state.message.push_str( + "Enabled filter PENDING │ Press p again to disable the filter", + ); + } } KeyCode::Char('r') => list_state.reset_selected()?, KeyCode::Char('c') => { |
