feat(collection): remove repeated formatting of label text

Because of a typo, the label text was being formatted multiple times per
label in a collection. With the fix, the text is formatted only once per
collection
This commit is contained in:
Nahor 2024-02-17 10:14:54 -08:00
parent 7f2496ecff
commit d144f7a28e
1 changed files with 4 additions and 4 deletions

View File

@ -217,8 +217,8 @@ impl Labels {
.map(|span| {
use miette::macro_helpers::{ToLabelSpanWrapper,ToLabeledSpan};
let mut labeled_span = ToLabelSpanWrapper::to_labeled_span(span.clone());
if #display.is_some() && labeled_span.label().is_none() {
labeled_span.set_label(#display)
if display.is_some() && labeled_span.label().is_none() {
labeled_span.set_label(display.clone())
}
labeled_span
})
@ -306,8 +306,8 @@ impl Labels {
.map(|span| {
use miette::macro_helpers::{ToLabelSpanWrapper,ToLabeledSpan};
let mut labeled_span = ToLabelSpanWrapper::to_labeled_span(span.clone());
if #display.is_some() && labeled_span.label().is_none() {
labeled_span.set_label(#display)
if display.is_some() && labeled_span.label().is_none() {
labeled_span.set_label(display.clone())
}
labeled_span
})