From 8d9961b75377a7bd2656b5aa1451710de8c86f60 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 28 Jul 2018 13:07:10 +0300 Subject: Migrate to text-unit --- src/parser/event.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/parser/event.rs') 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 @@ -use {ErrorMsg, File, FileBuilder, Sink, SyntaxKind, TextUnit, Token}; -use syntax_kinds::TOMBSTONE; +use { + ErrorMsg, File, FileBuilder, Sink, SyntaxKind, Token, + syntax_kinds::TOMBSTONE, +}; use super::is_insignificant; /// `Parser` produces a flat list of `Event`s. @@ -133,7 +135,7 @@ pub(super) fn to_file(text: String, tokens: &[Token], events: Vec) -> Fil builder.leaf(token.kind, token.len); idx += 1 } - let mut len = TextUnit::new(0); + let mut len = 0.into(); for _ in 0..n_raw_tokens { len += tokens[idx].len; idx += 1; -- cgit v1.2.3