Unnamed repository; edit this file 'description' to name the repository.
-rw-r--r--lib/text-size/src/range.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/text-size/src/range.rs b/lib/text-size/src/range.rs
index 16e52e1e4e..7fb4987149 100644
--- a/lib/text-size/src/range.rs
+++ b/lib/text-size/src/range.rs
@@ -54,6 +54,14 @@ pub fn TextRange(start: TextSize, end: TextSize) -> TextRange {
/// Identity methods.
impl TextRange {
+ /// Creates a zero-length range at the specified offset.
+ pub const fn empty(self, offset: TextSize) -> TextRange {
+ TextRange {
+ start: offset,
+ end: offset,
+ }
+ }
+
/// The start point of this range.
pub const fn start(self) -> TextSize {
self.start