mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-22 02:00:00 +03:00
Use is_dummy instead of comparing against DUMMY_SP
This commit is contained in:
@@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user