Skip to main content

complete_task

Function complete_task 

Source
pub fn complete_task(
    ito_path: &Path,
    change_id: &str,
    task_id: &str,
    _note: Option<String>,
) -> CoreResult<TaskItem>
Expand description

Mark a task in a change’s tracking file as complete.

Reads and validates the change’s tracking file, resolves the provided task identifier (supports enhanced ids and numeric indexes for checkbox format), updates the file setting the task’s status to Complete, and returns the updated task item.

§Returns

TaskItem representing the task with its status set to Complete.

§Errors

Returns a CoreError::validation if the tracking file contains parse errors or the update operation is rejected; CoreError::not_found if the specified task cannot be located; and CoreError::io for filesystem read/write failures.

§Examples

// Attempt to mark task "1.1" complete for change "1" in the repository at "."
let res = complete_task(Path::new("."), "1", "1.1", None);
// `res` will be `Ok(task)` on success or an error describing the failure.