Function todo_lib::todo::done

source ·
pub fn done(tasks: &mut TaskVec, ids: Option<&IDVec>) -> ChangedVec
Expand description

Marks todos completed.

It works differently for regular and recurrent ones. If a todo is a regular one and is not done yet, the function sets flag done and marks the todo as modified. If a todo is a recurrent one, the function pushes its due date to the next date (current due increased by recurrence value). Flag done is not set but the todo is marked modified.

  • tasks - the task list
  • ids - the list of todo IDs which should be completed. If it is None the entire task list is marked completed

Returns a list of boolean values: a value per each ID in ids or tasks. The length of the result list equals either length of ids(if ids is Some) or length of tasks(if ids is None). Value true in this array means that corresponding item from ids or tasks was modified.