From 50a3b394de35044524948629c20eef3618fd851f Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Tue, 14 Oct 2025 07:26:58 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(message=5Flist):?= =?UTF-8?q?=20rename=20run=20to=20get=5Fmessages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - rename run to get_messages for better clarity - remove async from add_labels trait and implementation --- src/message_list.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/message_list.rs b/src/message_list.rs index 9912e40..33dfa00 100644 --- a/src/message_list.rs +++ b/src/message_list.rs @@ -17,7 +17,7 @@ pub trait MessageList { next_page_token: Option, ) -> impl std::future::Future> + Send; /// Run something - fn run(&mut self, pages: u32) -> impl std::future::Future> + Send; + fn get_messages(&mut self, pages: u32) -> impl std::future::Future> + Send; /// Return the gmail hub fn hub(&self) -> Gmail>; /// Return the list of label_ids @@ -31,10 +31,7 @@ pub trait MessageList { /// Add label ids to the list of labels for the message list fn add_labels_ids(&mut self, label_ids: &[String]); /// Add labels to the list of labels for the message list - fn add_labels( - &mut self, - labels: &[String], - ) -> impl std::future::Future> + Send; + fn add_labels(&mut self, labels: &[String]) -> Result<()>; /// Report the max results value set fn max_results(&self) -> u32; /// Set the max_results value @@ -64,7 +61,7 @@ impl MessageList for GmailClient { } /// Add label to the labels collection - async fn add_labels(&mut self, labels: &[String]) -> Result<()> { + fn add_labels(&mut self, labels: &[String]) -> Result<()> { log::debug!("labels from command line: {labels:?}"); let mut label_ids = Vec::new(); for label in labels { @@ -115,7 +112,7 @@ impl MessageList for GmailClient { } /// Run the Gmail api as configured - async fn run(&mut self, pages: u32) -> Result<()> { + async fn get_messages(&mut self, pages: u32) -> Result<()> { let list = self.messages_list(None).await?; match pages { 1 => {}