diff options
Diffstat (limited to 'src/parser/input.rs')
-rw-r--r-- | src/parser/input.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/parser/input.rs b/src/parser/input.rs index 13589467b..9b400b959 100644 --- a/src/parser/input.rs +++ b/src/parser/input.rs | |||
@@ -14,7 +14,7 @@ impl<'t> ParserInput<'t> { | |||
14 | pub fn new(text: &'t str, raw_tokens: &'t [Token]) -> ParserInput<'t> { | 14 | pub fn new(text: &'t str, raw_tokens: &'t [Token]) -> ParserInput<'t> { |
15 | let mut tokens = Vec::new(); | 15 | let mut tokens = Vec::new(); |
16 | let mut start_offsets = Vec::new(); | 16 | let mut start_offsets = Vec::new(); |
17 | let mut len = TextUnit::new(0); | 17 | let mut len = 0.into(); |
18 | for &token in raw_tokens.iter() { | 18 | for &token in raw_tokens.iter() { |
19 | if !is_insignificant(token.kind) { | 19 | if !is_insignificant(token.kind) { |
20 | tokens.push(token); | 20 | tokens.push(token); |
@@ -44,7 +44,7 @@ impl<'t> ParserInput<'t> { | |||
44 | if !(idx < self.tokens.len()) { | 44 | if !(idx < self.tokens.len()) { |
45 | return ""; | 45 | return ""; |
46 | } | 46 | } |
47 | let range = TextRange::from_len(self.start_offsets[idx], self.tokens[idx].len); | 47 | let range = TextRange::offset_len(self.start_offsets[idx], self.tokens[idx].len); |
48 | &self.text[range] | 48 | &self.text[range] |
49 | } | 49 | } |
50 | } | 50 | } |