From 9625e6497980dc3a254979be8f842bcad18bf2ee Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Mon, 13 Oct 2025 15:52:20 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(message=5Flist):?= =?UTF-8?q?=20remove=20client=20parameter=20from=20add=5Flabels?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - remove client parameter from `add_labels` function to use self - simplify the function signature and improve code readability --- src/message_list.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/message_list.rs b/src/message_list.rs index 706b159..380029f 100644 --- a/src/message_list.rs +++ b/src/message_list.rs @@ -20,7 +20,7 @@ pub(crate) trait MessageList { fn messages(&self) -> &Vec; fn set_query(&mut self, query: &str); fn add_labels_ids(&mut self, label_ids: &[String]); - async fn add_labels(&mut self, client: &GmailClient, labels: &[String]) -> Result<()>; + async fn add_labels(&mut self, labels: &[String]) -> Result<()>; fn max_results(&self) -> u32; fn set_max_results(&mut self, value: u32); } @@ -48,11 +48,11 @@ impl MessageList for GmailClient { } /// Add label to the labels collection - async fn add_labels(&mut self, client: &GmailClient, labels: &[String]) -> Result<()> { + async 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 { - if let Some(id) = client.get_label_id(label) { + if let Some(id) = self.get_label_id(label) { label_ids.push(id) } }