fn remove(task_ids: Vec<usize>, state: &SharedState) -> Message {
    let mut state = state.lock().unwrap();
    let statuses = vec![
        TaskStatus::Queued,
        TaskStatus::Stashed,
        TaskStatus::Done,
        TaskStatus::Locked,
    ];
    let (not_running, running) = state.tasks_in_statuses(statuses, Some(task_ids));

    for task_id in &not_running {
        state.tasks.remove(task_id);
    }

    let text = "Tasks removed from list";
    let response = compile_task_response(text, not_running, running);
    create_success_message(response)
}
/// Invoked when calling `pueue remove`.
/// Remove tasks from the queue.
/// We have to ensure that those tasks aren't running!
Invoked when calling `pueue remove`.
Remove tasks from the queue.
We have to ensure that those tasks aren't running!
Invoked when calling ` pueue remove ` . Remove tasks from the queue . We have to ensure that those tasks aren ' t running!
fn remove(task_ids: Vec<usize>, state: &SharedState) -> Message {
    let mut state = state.lock().unwrap();
    let statuses = vec![
        TaskStatus::Queued,
        TaskStatus::Stashed,
        TaskStatus::Done,
        TaskStatus::Locked,
    ];
    let (not_running, running) = state.tasks_in_statuses(statuses, Some(task_ids));
    for task_id in &not_running {
        state.tasks.remove(task_id);
    }
    let text = "Tasks removed from list";
    let response = compile_task_response(text, not_running, running);
    create_success_message(response)
}
fn remove ( task_ids : Vec < usize > , state : & SharedState ) -> Message { let mut state = state . lock ( ) . unwrap ( ) ; let statuses = vec ! [ TaskStatus Queued TaskStatus Stashed TaskStatus Done TaskStatus Locked ] ; let ( not_running , running ) = state . tasks_in_statuses ( statuses , Some ( task_ids ) ) ; for task_id in & not_running { state . tasks . remove ( task_id ) ; } let text = " " ; let response = compile_task_response ( text , not_running , running ) ; create_success_message ( response ) }
Invoked when calling `pueue remove`.
Invoked when calling ` pueue remove ` .
task_ids
Vec<usize>
state
&SharedState