From b1d5817dd18b7b5fc102a63b084b1ee7ff4f9996 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 24 Apr 2020 23:40:41 +0200 Subject: Convert code to text-size --- crates/ra_hir_expand/src/builtin_macro.rs | 4 ++-- crates/ra_hir_expand/src/lib.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/ra_hir_expand/src') diff --git a/crates/ra_hir_expand/src/builtin_macro.rs b/crates/ra_hir_expand/src/builtin_macro.rs index 3da137f2e..2ccebda28 100644 --- a/crates/ra_hir_expand/src/builtin_macro.rs +++ b/crates/ra_hir_expand/src/builtin_macro.rs @@ -2,7 +2,7 @@ use crate::db::AstDatabase; use crate::{ ast::{self, AstToken, HasStringValue}, - name, AstId, CrateId, MacroDefId, MacroDefKind, TextUnit, + name, AstId, CrateId, MacroDefId, MacroDefKind, TextSize, }; use crate::{quote, EagerMacroId, LazyMacroId, MacroCallId}; @@ -127,7 +127,7 @@ fn stringify_expand( let arg = loc.kind.arg(db).ok_or_else(|| mbe::ExpandError::UnexpectedToken)?; let macro_args = arg; let text = macro_args.text(); - let without_parens = TextUnit::of_char('(')..text.len() - TextUnit::of_char(')'); + let without_parens = TextSize::of('(')..text.len() - TextSize::of(')'); text.slice(without_parens).to_string() }; diff --git a/crates/ra_hir_expand/src/lib.rs b/crates/ra_hir_expand/src/lib.rs index 86299459f..754a0f005 100644 --- a/crates/ra_hir_expand/src/lib.rs +++ b/crates/ra_hir_expand/src/lib.rs @@ -22,7 +22,7 @@ use ra_db::{impl_intern_key, salsa, CrateId, FileId}; use ra_syntax::{ algo, ast::{self, AstNode}, - SyntaxNode, SyntaxToken, TextUnit, + SyntaxNode, SyntaxToken, TextSize, }; use crate::ast_id_map::FileAstId; @@ -348,7 +348,7 @@ impl AstId { /// /// * `InFile` -- syntax node in a file /// * `InFile` -- ast node in a file -/// * `InFile` -- offset in a file +/// * `InFile` -- offset in a file #[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)] pub struct InFile { pub file_id: HirFileId, -- cgit v1.2.3