fix: collapse nested if into match guard
This commit is contained in:
@@ -425,16 +425,15 @@ pub fn processes_handle_key_with_selection(params: ProcessKeyParams) -> bool {
|
|||||||
}
|
}
|
||||||
true // Handled
|
true // Handled
|
||||||
}
|
}
|
||||||
KeyCode::Char('x') | KeyCode::Char('X') => {
|
KeyCode::Char('x') | KeyCode::Char('X')
|
||||||
// Unselect any selected process
|
if params.selected_process_pid.is_some()
|
||||||
if params.selected_process_pid.is_some() || params.selected_process_index.is_some() {
|
|| params.selected_process_index.is_some() =>
|
||||||
*params.selected_process_pid = None;
|
{
|
||||||
*params.selected_process_index = None;
|
*params.selected_process_pid = None;
|
||||||
true // Handled
|
*params.selected_process_index = None;
|
||||||
} else {
|
true
|
||||||
false // No selection to clear
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
KeyCode::Char('x') | KeyCode::Char('X') => false,
|
||||||
KeyCode::Enter => {
|
KeyCode::Enter => {
|
||||||
// Signal that Enter was pressed with a selection
|
// Signal that Enter was pressed with a selection
|
||||||
params.selected_process_pid.is_some() // Return true if we have a selection to handle
|
params.selected_process_pid.is_some() // Return true if we have a selection to handle
|
||||||
|
|||||||
Reference in New Issue
Block a user