diff options
author | Aleksey Kladov <[email protected]> | 2018-10-30 18:26:55 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-10-30 18:26:55 +0000 |
commit | 1643d94a65a66f32b9278829dd3af00883f3852b (patch) | |
tree | 95344947f1957d03edcbcd6ef8a2786cc1b9142d /crates/ra_syntax/src/text_utils.rs | |
parent | 950e8b8182897da60bcece70d84e9f0b6dc88632 (diff) |
switch to TextRange::subrange
Diffstat (limited to 'crates/ra_syntax/src/text_utils.rs')
-rw-r--r-- | crates/ra_syntax/src/text_utils.rs | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/crates/ra_syntax/src/text_utils.rs b/crates/ra_syntax/src/text_utils.rs index abda5ec39..a90f8a083 100644 --- a/crates/ra_syntax/src/text_utils.rs +++ b/crates/ra_syntax/src/text_utils.rs | |||
@@ -4,10 +4,6 @@ pub fn contains_offset_nonstrict(range: TextRange, offset: TextUnit) -> bool { | |||
4 | range.start() <= offset && offset <= range.end() | 4 | range.start() <= offset && offset <= range.end() |
5 | } | 5 | } |
6 | 6 | ||
7 | pub fn is_subrange(range: TextRange, subrange: TextRange) -> bool { | ||
8 | range.start() <= subrange.start() && subrange.end() <= range.end() | ||
9 | } | ||
10 | |||
11 | pub fn intersect(r1: TextRange, r2: TextRange) -> Option<TextRange> { | 7 | pub fn intersect(r1: TextRange, r2: TextRange) -> Option<TextRange> { |
12 | let start = r1.start().max(r2.start()); | 8 | let start = r1.start().max(r2.start()); |
13 | let end = r1.end().min(r2.end()); | 9 | let end = r1.end().min(r2.end()); |