From cef9831dd7229691d14d8f5af6065386267f483d Mon Sep 17 00:00:00 2001 From: Jeremiah Russell Date: Fri, 3 Oct 2025 16:37:56 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(labels):=20simpli?= =?UTF-8?q?fy=20and=20optimize=20label=20retrieval=20-=20rename=20function?= =?UTF-8?q?=20name=20`add=5Flabel`=20to=20`add=5Flabels`=20-=20add=20the?= =?UTF-8?q?=20function=20of=20adding=20multiple=20labels=20at=20once=20-?= =?UTF-8?q?=20optimize=20code=20for=20streamlined=20operation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/list.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/list.rs b/src/list.rs index c00644c..8249ebb 100644 --- a/src/list.rs +++ b/src/list.rs @@ -69,8 +69,12 @@ impl List { } /// Add label to the labels collection - pub fn add_label(&mut self, label_id: &str) { - self.label_ids.push(label_id.to_string()) + pub fn add_labels(&mut self, label_ids: &[String]) { + if !label_ids.is_empty() { + for id in label_ids { + self.label_ids.push(id.to_string()) + } + } } /// Run the Gmail api as configured