diff --git a/crates/ra_syntax/src/parser_impl/event.rs b/crates/ra_syntax/src/parser_impl/event.rs index 1445401bcf70..bf9c1cef0955 100644 --- a/crates/ra_syntax/src/parser_impl/event.rs +++ b/crates/ra_syntax/src/parser_impl/event.rs @@ -162,9 +162,10 @@ impl<'a, S: Sink> EventProcessor<'a, S> { .sum::(); self.leaf(kind, len, n_raw_tokens); } - Event::Error { msg } => self.sink.error( - SyntaxError::new(SyntaxErrorKind::ParseError(msg), self.text_pos), - ), + Event::Error { msg } => self.sink.error(SyntaxError::new( + SyntaxErrorKind::ParseError(msg), + self.text_pos, + )), } } self.sink diff --git a/crates/ra_syntax/src/yellow/syntax_error.rs b/crates/ra_syntax/src/yellow/syntax_error.rs index 098366f857af..f3df6bc15318 100644 --- a/crates/ra_syntax/src/yellow/syntax_error.rs +++ b/crates/ra_syntax/src/yellow/syntax_error.rs @@ -28,7 +28,10 @@ impl Into for TextRange { impl SyntaxError { pub fn new>(kind: SyntaxErrorKind, loc: L) -> SyntaxError { - SyntaxError { kind, location: loc.into() } + SyntaxError { + kind, + location: loc.into(), + } } pub fn location(&self) -> Location { @@ -45,7 +48,7 @@ impl SyntaxError { pub fn add_offset(mut self, plus_offset: TextUnit) -> SyntaxError { self.location = match self.location { Location::Range(range) => Location::Range(range + plus_offset), - Location::Offset(offset) => Location::Offset(offset + plus_offset) + Location::Offset(offset) => Location::Offset(offset + plus_offset), }; self