switch to TextRange::subrange

This commit is contained in:
Aleksey Kladov 2018-10-30 21:26:55 +03:00
parent 950e8b8182
commit 1643d94a65
4 changed files with 4 additions and 10 deletions

View file

@ -4,10 +4,6 @@ pub fn contains_offset_nonstrict(range: TextRange, offset: TextUnit) -> bool {
range.start() <= offset && offset <= range.end()
}
pub fn is_subrange(range: TextRange, subrange: TextRange) -> bool {
range.start() <= subrange.start() && subrange.end() <= range.end()
}
pub fn intersect(r1: TextRange, r2: TextRange) -> Option<TextRange> {
let start = r1.start().max(r2.start());
let end = r1.end().min(r2.end());