diff options
author | Aleksey Kladov <[email protected]> | 2020-04-24 22:40:41 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-04-25 10:59:18 +0100 |
commit | b1d5817dd18b7b5fc102a63b084b1ee7ff4f9996 (patch) | |
tree | e5d136c5ba4a6ba96aeeb423e6e3f64ca7cea3f9 /crates/ra_hir_expand/src | |
parent | 27a7718880d93f55f905da606d108d3b3c682ab4 (diff) |
Convert code to text-size
Diffstat (limited to 'crates/ra_hir_expand/src')
-rw-r--r-- | crates/ra_hir_expand/src/builtin_macro.rs | 4 | ||||
-rw-r--r-- | crates/ra_hir_expand/src/lib.rs | 4 |
2 files changed, 4 insertions, 4 deletions
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 @@ | |||
2 | use crate::db::AstDatabase; | 2 | use crate::db::AstDatabase; |
3 | use crate::{ | 3 | use crate::{ |
4 | ast::{self, AstToken, HasStringValue}, | 4 | ast::{self, AstToken, HasStringValue}, |
5 | name, AstId, CrateId, MacroDefId, MacroDefKind, TextUnit, | 5 | name, AstId, CrateId, MacroDefId, MacroDefKind, TextSize, |
6 | }; | 6 | }; |
7 | 7 | ||
8 | use crate::{quote, EagerMacroId, LazyMacroId, MacroCallId}; | 8 | use crate::{quote, EagerMacroId, LazyMacroId, MacroCallId}; |
@@ -127,7 +127,7 @@ fn stringify_expand( | |||
127 | let arg = loc.kind.arg(db).ok_or_else(|| mbe::ExpandError::UnexpectedToken)?; | 127 | let arg = loc.kind.arg(db).ok_or_else(|| mbe::ExpandError::UnexpectedToken)?; |
128 | let macro_args = arg; | 128 | let macro_args = arg; |
129 | let text = macro_args.text(); | 129 | let text = macro_args.text(); |
130 | let without_parens = TextUnit::of_char('(')..text.len() - TextUnit::of_char(')'); | 130 | let without_parens = TextSize::of('(')..text.len() - TextSize::of(')'); |
131 | text.slice(without_parens).to_string() | 131 | text.slice(without_parens).to_string() |
132 | }; | 132 | }; |
133 | 133 | ||
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}; | |||
22 | use ra_syntax::{ | 22 | use ra_syntax::{ |
23 | algo, | 23 | algo, |
24 | ast::{self, AstNode}, | 24 | ast::{self, AstNode}, |
25 | SyntaxNode, SyntaxToken, TextUnit, | 25 | SyntaxNode, SyntaxToken, TextSize, |
26 | }; | 26 | }; |
27 | 27 | ||
28 | use crate::ast_id_map::FileAstId; | 28 | use crate::ast_id_map::FileAstId; |
@@ -348,7 +348,7 @@ impl<N: AstNode> AstId<N> { | |||
348 | /// | 348 | /// |
349 | /// * `InFile<SyntaxNode>` -- syntax node in a file | 349 | /// * `InFile<SyntaxNode>` -- syntax node in a file |
350 | /// * `InFile<ast::FnDef>` -- ast node in a file | 350 | /// * `InFile<ast::FnDef>` -- ast node in a file |
351 | /// * `InFile<TextUnit>` -- offset in a file | 351 | /// * `InFile<TextSize>` -- offset in a file |
352 | #[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)] | 352 | #[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)] |
353 | pub struct InFile<T> { | 353 | pub struct InFile<T> { |
354 | pub file_id: HirFileId, | 354 | pub file_id: HirFileId, |