From f553837c1ca30a52bf5091689c21d3c3e3362395 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 8 Jan 2019 21:50:04 +0300 Subject: upstream text-utils to text_unit --- crates/ra_editor/src/typing.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'crates/ra_editor') diff --git a/crates/ra_editor/src/typing.rs b/crates/ra_editor/src/typing.rs index 576caf6be..d8177f245 100644 --- a/crates/ra_editor/src/typing.rs +++ b/crates/ra_editor/src/typing.rs @@ -4,12 +4,10 @@ use itertools::Itertools; use ra_syntax::{ algo::{find_node_at_offset, find_covering_node, find_leaf_at_offset, LeafAtOffset}, ast, - text_utils::intersect, AstNode, Direction, SourceFile, SyntaxKind, SyntaxKind::*, SyntaxNode, TextRange, TextUnit, }; -use ra_text_edit::text_utils::contains_offset_nonstrict; use crate::{LocalEdit, TextEditBuilder}; @@ -39,7 +37,7 @@ pub fn join_lines(file: &SourceFile, range: TextRange) -> LocalEdit { Some(text) => text, None => continue, }; - let range = match intersect(range, node.range()) { + let range = match range.intersection(&node.range()) { Some(range) => range, None => continue, } - node.range().start(); @@ -112,7 +110,7 @@ pub fn on_eq_typed(file: &SourceFile, offset: TextUnit) -> Option { } if let Some(expr) = let_stmt.initializer() { let expr_range = expr.syntax().range(); - if contains_offset_nonstrict(expr_range, offset) && offset != expr_range.start() { + if expr_range.contains(offset) && offset != expr_range.start() { return None; } if file -- cgit v1.2.3