From 1b7dbd07150d4ef071b3d8abda355f8cca772112 Mon Sep 17 00:00:00 2001 From: "Dustin J. Mitchell" Date: Sun, 29 Nov 2020 13:46:52 -0500 Subject: [PATCH] remove delete_task from the Replica API so it's not misused --- cli/src/cmd/delete.rs | 1 - taskchampion/src/replica.rs | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cli/src/cmd/delete.rs b/cli/src/cmd/delete.rs index 1d36833ec..67acf4693 100644 --- a/cli/src/cmd/delete.rs +++ b/cli/src/cmd/delete.rs @@ -49,4 +49,3 @@ mod test { }); } } - diff --git a/taskchampion/src/replica.rs b/taskchampion/src/replica.rs index 525be9888..6e4550ebd 100644 --- a/taskchampion/src/replica.rs +++ b/taskchampion/src/replica.rs @@ -135,8 +135,10 @@ impl Replica { } /// Delete a task. The task must exist. Note that this is different from setting status to - /// Deleted; this is the final purge of the task. - pub fn delete_task(&mut self, uuid: &Uuid) -> Fallible<()> { + /// Deleted; this is the final purge of the task. This is not a public method as deletion + /// should only occur through expiration. + #[allow(dead_code)] + fn delete_task(&mut self, uuid: &Uuid) -> Fallible<()> { // check that it already exists; this is a convenience check, as the task may already exist // when this Create operation is finally sync'd with operations from other replicas if self.taskdb.get_task(&uuid)?.is_none() {