From 7eeebddf2ef522a211354e25d8b6d60ec7658211 Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 13 Oct 2025 13:55:26 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(cli):=20use=20Gma?= =?UTF-8?q?ilClient=20for=20MessageList?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - use GmailClient instance instead of credential file path - pass GmailClient to add_labels --- src/cli/message_cli.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cli/message_cli.rs b/src/cli/message_cli.rs index 6ac9bea..97d980c 100644 --- a/src/cli/message_cli.rs +++ b/src/cli/message_cli.rs @@ -1,5 +1,5 @@ use clap::Parser; -use cull_gmail::{MessageList, Result}; +use cull_gmail::{GmailClient, MessageList, Result}; /// Command line options for the list subcommand #[derive(Debug, Parser)] @@ -19,11 +19,11 @@ pub struct MessageCli { } impl MessageCli { - pub(crate) async fn run(&self, credential_file: &str) -> Result<()> { - let mut list = MessageList::new(credential_file).await?; + pub(crate) async fn run(&self, client: &GmailClient) -> Result<()> { + let mut list = MessageList::new(client).await?; if !self.labels.is_empty() { - list.add_labels(credential_file, &self.labels).await?; + list.add_labels(client, &self.labels).await?; } if let Some(query) = self.query.as_ref() {