pub fn span_labels(&self) -> Vec<SpanLabel> {
        let is_primary = |span| self.primary_spans.contains(&span);
        let mut span_labels = vec![];

        for &(span, ref label) in &self.span_labels {
            span_labels.push(SpanLabel {
                span: span,
                is_primary: is_primary(span),
                label: Some(label.clone())
            });
        }

        for &span in &self.primary_spans {
            if !span_labels.iter().any(|sl| sl.span == span) {
                span_labels.push(SpanLabel {
                    span: span,
                    is_primary: true,
                    label: None
                });
            }
        }

        span_labels
    }
/// Returns the strings to highlight. We always ensure that there
/// is an entry for each of the primary spans -- for each primary
/// span P, if there is at least one label with span P, we return
/// those labels (marked as primary). But otherwise we return
/// `SpanLabel` instances with empty labels.
Returns the strings to highlight. We always ensure that there
is an entry for each of the primary spans -- for each primary
span P, if there is at least one label with span P, we return
those labels (marked as primary). But otherwise we return
`SpanLabel` instances with empty labels.
Returns the strings to highlight . We always ensure that there is an entry for each of the primary spans -- for each primary span P if there is at least one label with span P we return those labels ( marked as primary ) . But otherwise we return ` SpanLabel ` instances with empty labels .
pub fn span_labels(&self) -> Vec<SpanLabel> {
        let is_primary = |span| self.primary_spans.contains(&span);
        let mut span_labels = vec![];
        for &(span, ref label) in &self.span_labels {
            span_labels.push(SpanLabel {
                span: span,
                is_primary: is_primary(span),
                label: Some(label.clone())
            });
        }
        for &span in &self.primary_spans {
            if !span_labels.iter().any(|sl| sl.span == span) {
                span_labels.push(SpanLabel {
                    span: span,
                    is_primary: true,
                    label: None
                });
            }
        }
        span_labels
    }
pub fn span_labels ( & self ) -> Vec < SpanLabel > { let is_primary = | span | self . primary_spans . contains ( & span ) ; let mut span_labels = vec ! [ ] ; for & ( span , ref label ) in & self . span_labels { span_labels . push ( SpanLabel { span : span , is_primary : is_primary ( span ) , label : Some ( label . clone ( ) ) } ) ; } for & span in & self . primary_spans { if ! span_labels . iter ( ) . any ( | sl | sl . span == span ) { span_labels . push ( SpanLabel { span : span , is_primary : true , label : None } ) ; } } span_labels }
Returns the strings to highlight.
Returns the strings to highlight .
&self
&self