♻️ refactor(eol_rule): improve labels handling
- use `cloned()` instead of `map(|i| i.to_string())` for better efficiency
This commit is contained in:
committed by
Jeremiah Russell
parent
972f3bb264
commit
55b1d9a25d
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user