Use is_dummy instead of comparing against DUMMY_SP

This commit is contained in:
Esteban Küber
2019-01-20 13:53:13 -08:00
parent c4b8df5df2
commit 8f4da0e7ee
+2 -2
View File
@@ -670,7 +670,7 @@ pub fn primary_spans(&self) -> &[Span] {
/// Returns wether any of the primary spans is displayable.
pub fn has_primary_spans(&self) -> bool {
self.primary_spans.iter().any(|sp| *sp != DUMMY_SP)
self.primary_spans.iter().any(|sp| !sp.is_dummy())
}
/// Returns `true` if this contains only a dummy primary span with any hygienic context.
@@ -734,7 +734,7 @@ pub fn span_labels(&self) -> Vec<SpanLabel> {
/// Returns wether any of the span labels is displayable.
pub fn has_span_labels(&self) -> bool {
self.span_labels.iter().any(|(sp, _)| *sp != DUMMY_SP)
self.span_labels.iter().any(|(sp, _)| !sp.is_dummy())
}
}