♻️ refactor(eol_rule): improve labels handling

- use `cloned()` instead of `map(|i| i.to_string())` for better efficiency
This commit is contained in:
Jeremiah Russell
2025-10-15 11:21:08 +01:00
committed by Jeremiah Russell
parent 972f3bb264
commit 55b1d9a25d

View File

@@ -26,7 +26,7 @@ impl fmt::Display for EolRule {
self.id, self.id,
self.labels self.labels
.iter() .iter()
.map(|i| i.to_string()) .cloned()
.collect::<Vec<String>>() .collect::<Vec<String>>()
.join(", ") .join(", ")
) )
@@ -73,7 +73,7 @@ impl EolRule {
/// List the labels in the rules /// List the labels in the rules
pub fn labels(&self) -> Vec<String> { pub fn labels(&self) -> Vec<String> {
self.labels.iter().map(|i| i.to_string()).collect() self.labels.iter().cloned().collect()
} }
pub(crate) fn set_action(&mut self, value: &EolAction) -> &mut Self { pub(crate) fn set_action(&mut self, value: &EolAction) -> &mut Self {