From 22e1916262710c82d35a18ab4bf50d660f7063ff Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 13 Oct 2025 13:53:38 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(cli):=20use=20Gma?= =?UTF-8?q?ilClient=20in=20delete=5Fcli?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - use GmailClient struct instead of credential_file path - simplifies client handling and avoids redundant credential loading --- src/cli/delete_cli.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cli/delete_cli.rs b/src/cli/delete_cli.rs index 9ca83d6..9a1177b 100644 --- a/src/cli/delete_cli.rs +++ b/src/cli/delete_cli.rs @@ -1,5 +1,5 @@ use clap::Parser; -use cull_gmail::{Delete, Result}; +use cull_gmail::{Delete, GmailClient, Result}; /// Command line options for the list subcommand #[derive(Debug, Parser)] @@ -22,14 +22,14 @@ pub struct DeleteCli { } impl DeleteCli { - pub(crate) async fn run(&self, credential_file: &str) -> Result<()> { - let mut messages_to_delete = Delete::new(credential_file).await?; + pub(crate) async fn run(&self, client: &GmailClient) -> Result<()> { + let mut messages_to_delete = Delete::new(client).await?; if !self.labels.is_empty() { // add labels if any specified messages_to_delete .message_list() - .add_labels(credential_file, &self.labels) + .add_labels(client, &self.labels) .await?; }