summaryrefslogtreecommitdiff
path: root/src/syntax/span.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-11-15 16:59:49 +0100
committerLaurenz <laurmaedje@gmail.com>2021-11-15 17:06:43 +0100
commit63c274e7f6aa3a8c3f43abb91935ec924a186f73 (patch)
tree193777ff773c6b547c6ef828ddf9750694fae7bc /src/syntax/span.rs
parent8a38899c98b4f9829b2d1f21c8fee66d254d20c6 (diff)
Make clippy happier and remove `Str`
Diffstat (limited to 'src/syntax/span.rs')
-rw-r--r--src/syntax/span.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/syntax/span.rs b/src/syntax/span.rs
index 47d96589..4d5b8819 100644
--- a/src/syntax/span.rs
+++ b/src/syntax/span.rs
@@ -88,6 +88,11 @@ impl Span {
Self { end, ..self }
}
+ /// Whether the span is a single point.
+ pub fn is_empty(self) -> bool {
+ self.start == self.end
+ }
+
/// The byte length of the spanned region.
pub fn len(self) -> usize {
self.end - self.start