♻️ refactor(labels): simplify and optimize label retrieval

- rename function name `add_label` to `add_labels`
- add the function of adding multiple labels at once
- optimize code for streamlined operation
This commit is contained in:
Jeremiah Russell
2025-10-03 16:37:56 +01:00
committed by Jeremiah Russell
parent 58de6397ce
commit cef9831dd7

View File

@@ -69,8 +69,12 @@ impl List {
} }
/// Add label to the labels collection /// Add label to the labels collection
pub fn add_label(&mut self, label_id: &str) { pub fn add_labels(&mut self, label_ids: &[String]) {
self.label_ids.push(label_id.to_string()) if !label_ids.is_empty() {
for id in label_ids {
self.label_ids.push(id.to_string())
}
}
} }
/// Run the Gmail api as configured /// Run the Gmail api as configured