diff options
author | Aleksey Kladov <[email protected]> | 2018-07-28 11:07:10 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-07-28 11:07:10 +0100 |
commit | 8d9961b75377a7bd2656b5aa1451710de8c86f60 (patch) | |
tree | c2dcedf487d2ad4674edb012dd579aa74173d8c2 /src/parser/event.rs | |
parent | 52dc0ddc84544a59d3a2580d9944d0482a633349 (diff) |
Migrate to text-unit
Diffstat (limited to 'src/parser/event.rs')
-rw-r--r-- | src/parser/event.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/parser/event.rs b/src/parser/event.rs index 1c0905a38..ac8a55de9 100644 --- a/src/parser/event.rs +++ b/src/parser/event.rs | |||
@@ -1,5 +1,7 @@ | |||
1 | use {ErrorMsg, File, FileBuilder, Sink, SyntaxKind, TextUnit, Token}; | 1 | use { |
2 | use syntax_kinds::TOMBSTONE; | 2 | ErrorMsg, File, FileBuilder, Sink, SyntaxKind, Token, |
3 | syntax_kinds::TOMBSTONE, | ||
4 | }; | ||
3 | use super::is_insignificant; | 5 | use super::is_insignificant; |
4 | 6 | ||
5 | /// `Parser` produces a flat list of `Event`s. | 7 | /// `Parser` produces a flat list of `Event`s. |
@@ -133,7 +135,7 @@ pub(super) fn to_file(text: String, tokens: &[Token], events: Vec<Event>) -> Fil | |||
133 | builder.leaf(token.kind, token.len); | 135 | builder.leaf(token.kind, token.len); |
134 | idx += 1 | 136 | idx += 1 |
135 | } | 137 | } |
136 | let mut len = TextUnit::new(0); | 138 | let mut len = 0.into(); |
137 | for _ in 0..n_raw_tokens { | 139 | for _ in 0..n_raw_tokens { |
138 | len += tokens[idx].len; | 140 | len += tokens[idx].len; |
139 | idx += 1; | 141 | idx += 1; |