From 351107d0b143e2c3497bd0f424f0d76bc51df0c0 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 4 Feb 2018 17:06:43 +0300 Subject: Reformat --- src/parser/event.rs | 4 ++-- src/parser/grammar/items/mod.rs | 2 +- src/parser/input.rs | 5 +---- src/parser/parser.rs | 1 - 4 files changed, 4 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/parser/event.rs b/src/parser/event.rs index 64d751d63..e97350c89 100644 --- a/src/parser/event.rs +++ b/src/parser/event.rs @@ -1,4 +1,4 @@ -use {File, FileBuilder, Sink, SyntaxKind, Token, TextUnit}; +use {File, FileBuilder, Sink, SyntaxKind, TextUnit, Token}; use syntax_kinds::TOMBSTONE; use super::is_insignificant; @@ -139,7 +139,7 @@ pub(super) fn to_file(text: String, tokens: &[Token], events: Vec) -> Fil idx += 1; } builder.leaf(kind, len); - }, + } &Event::Error { ref message } => builder.error().message(message.clone()).emit(), } } diff --git a/src/parser/grammar/items/mod.rs b/src/parser/grammar/items/mod.rs index 588fca4c6..37f2ab132 100644 --- a/src/parser/grammar/items/mod.rs +++ b/src/parser/grammar/items/mod.rs @@ -122,7 +122,7 @@ fn item(p: &mut Parser) { if !p.at(FN_KW) { item.abandon(p); p.error().message("expected function").emit(); - return + return; } fn_item(p); FN_ITEM diff --git a/src/parser/input.rs b/src/parser/input.rs index 2ad621166..4d74ac1b1 100644 --- a/src/parser/input.rs +++ b/src/parser/input.rs @@ -46,10 +46,7 @@ impl<'t> ParserInput<'t> { if !(idx < self.tokens.len()) { return ""; } - let range = TextRange::from_len( - self.start_offsets[idx], - self.tokens[idx].len - ); + let range = TextRange::from_len(self.start_offsets[idx], self.tokens[idx].len); &self.text[range] } } diff --git a/src/parser/parser.rs b/src/parser/parser.rs index 53a116fb7..752d532d0 100644 --- a/src/parser/parser.rs +++ b/src/parser/parser.rs @@ -169,7 +169,6 @@ impl<'t> Parser<'t> { self.nth(0) } - fn event(&mut self, event: Event) { self.events.push(event) } -- cgit v1.2.3