We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
is_empty
Span
1 parent 24fbb30 commit 49fc420Copy full SHA for 49fc420
src/libsyntax_pos/lib.rs
@@ -280,6 +280,13 @@ impl Span {
280
self.data().with_ctxt(ctxt)
281
}
282
283
+ #[inline]
284
+ /// Returns `true` if this `Span` contains no text.
285
+ pub fn is_empty(self) -> bool {
286
+ let span = self.data();
287
+ span.lo == span.hi
288
+ }
289
+
290
/// Returns `true` if this is a dummy span with any hygienic context.
291
#[inline]
292
pub fn is_dummy(self) -> bool {
0 commit comments