mirror of https://github.com/zkat/miette.git
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:
parent
7f2496ecff
commit
d144f7a28e
|
|
@ -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
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue