aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/text_utils.rs
diff options
context:
space:
mode:
authorBernardo <[email protected]>2018-12-10 21:09:12 +0000
committerBernardo <[email protected]>2018-12-10 21:09:12 +0000
commit7344d28768c43d8955bf23c183d606be08f27c64 (patch)
treef0773b4db640dac303f1f683115c780ac3eb0b9c /crates/ra_syntax/src/text_utils.rs
parentf655f993fe6d9faa81b0e776b9b24308d2ea1c68 (diff)
extract AtomEdit and Edit into new ra_text_edit crate
Diffstat (limited to 'crates/ra_syntax/src/text_utils.rs')
-rw-r--r--crates/ra_syntax/src/text_utils.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/crates/ra_syntax/src/text_utils.rs b/crates/ra_syntax/src/text_utils.rs
index a90f8a083..417d43e1b 100644
--- a/crates/ra_syntax/src/text_utils.rs
+++ b/crates/ra_syntax/src/text_utils.rs
@@ -1,8 +1,4 @@
1use crate::{TextRange, TextUnit}; 1use crate::TextRange;
2
3pub fn contains_offset_nonstrict(range: TextRange, offset: TextUnit) -> bool {
4 range.start() <= offset && offset <= range.end()
5}
6 2
7pub fn intersect(r1: TextRange, r2: TextRange) -> Option<TextRange> { 3pub fn intersect(r1: TextRange, r2: TextRange) -> Option<TextRange> {
8 let start = r1.start().max(r2.start()); 4 let start = r1.start().max(r2.start());