Skip to content

Commit 806f884

Browse files
committed
Sprinkle inline
1 parent ccae768 commit 806f884

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/range.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ impl TextRange {
157157
/// assert!(range.contains(start));
158158
/// assert!(!range.contains(end));
159159
/// ```
160+
#[inline]
160161
pub fn contains(self, offset: TextSize) -> bool {
161162
self.start() <= offset && offset < self.end()
162163
}
@@ -175,6 +176,7 @@ impl TextRange {
175176
/// assert!(range.contains_inclusive(start));
176177
/// assert!(range.contains_inclusive(end));
177178
/// ```
179+
#[inline]
178180
pub fn contains_inclusive(self, offset: TextSize) -> bool {
179181
self.start() <= offset && offset <= self.end()
180182
}
@@ -194,6 +196,7 @@ impl TextRange {
194196
/// assert!(larger.contains_range(larger));
195197
/// assert!(smaller.contains_range(smaller));
196198
/// ```
199+
#[inline]
197200
pub fn contains_range(self, other: TextRange) -> bool {
198201
self.start() <= other.start() && other.end() <= self.end()
199202
}
@@ -213,6 +216,7 @@ impl TextRange {
213216
/// Some(TextRange::new(5.into(), 10.into())),
214217
/// );
215218
/// ```
219+
#[inline]
216220
pub fn intersect(self, other: TextRange) -> Option<TextRange> {
217221
let start = cmp::max(self.start(), other.start());
218222
let end = cmp::min(self.end(), other.end());
@@ -236,6 +240,7 @@ impl TextRange {
236240
/// TextRange::new(0.into(), 20.into()),
237241
/// );
238242
/// ```
243+
#[inline]
239244
pub fn cover(self, other: TextRange) -> TextRange {
240245
let start = cmp::min(self.start(), other.start());
241246
let end = cmp::max(self.end(), other.end());
@@ -253,6 +258,7 @@ impl TextRange {
253258
/// TextRange::new(0.into(), 20.into()),
254259
/// )
255260
/// ```
261+
#[inline]
256262
pub fn cover_offset(self, offset: TextSize) -> TextRange {
257263
self.cover(TextRange::empty(offset))
258264
}

0 commit comments

Comments
 (0)