mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
switch to TextRange::subrange
This commit is contained in:
parent
950e8b8182
commit
1643d94a65
4 changed files with 4 additions and 10 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue