mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
extract AtomEdit and Edit into new ra_text_edit crate
This commit is contained in:
parent
f655f993fe
commit
7344d28768
19 changed files with 81 additions and 40 deletions
|
@ -1,8 +1,4 @@
|
|||
use crate::{TextRange, TextUnit};
|
||||
|
||||
pub fn contains_offset_nonstrict(range: TextRange, offset: TextUnit) -> bool {
|
||||
range.start() <= offset && offset <= range.end()
|
||||
}
|
||||
use crate::TextRange;
|
||||
|
||||
pub fn intersect(r1: TextRange, r2: TextRange) -> Option<TextRange> {
|
||||
let start = r1.start().max(r2.start());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue