From 6dbba4d75d56728a95f84ee978eae3ac84016c73 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 15 Jan 2021 20:15:33 +0300 Subject: Remove useless wrapper --- crates/hir_expand/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/hir_expand/src/lib.rs') diff --git a/crates/hir_expand/src/lib.rs b/crates/hir_expand/src/lib.rs index 3fa1b1d77..e388ddacc 100644 --- a/crates/hir_expand/src/lib.rs +++ b/crates/hir_expand/src/lib.rs @@ -22,7 +22,7 @@ use std::sync::Arc; use base_db::{impl_intern_key, salsa, CrateId, FileId, FileRange}; use syntax::{ - algo::{self, skip_trivia_token}, + algo::skip_trivia_token, ast::{self, AstNode}, Direction, SyntaxNode, SyntaxToken, TextRange, TextSize, }; @@ -335,7 +335,7 @@ impl ExpansionInfo { let range = self.exp_map.range_by_token(token_id)?.by_kind(token.value.kind())?; - let token = algo::find_covering_element(&self.expanded.value, range).into_token()?; + let token = self.expanded.value.covering_element(range).into_token()?; Some(self.expanded.with_value(token)) } @@ -360,8 +360,8 @@ impl ExpansionInfo { }; let range = token_map.range_by_token(token_id)?.by_kind(token.value.kind())?; - let token = algo::find_covering_element(&tt.value, range + tt.value.text_range().start()) - .into_token()?; + let token = + tt.value.covering_element(range + tt.value.text_range().start()).into_token()?; Some((tt.with_value(token), origin)) } } -- cgit v1.2.3