diff options
Diffstat (limited to 'crates/ra_syntax/src/yellow')
-rw-r--r-- | crates/ra_syntax/src/yellow/syntax_error.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/ra_syntax/src/yellow/syntax_error.rs b/crates/ra_syntax/src/yellow/syntax_error.rs index 098366f85..f3df6bc15 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<Location> for TextRange { | |||
28 | 28 | ||
29 | impl SyntaxError { | 29 | impl SyntaxError { |
30 | pub fn new<L: Into<Location>>(kind: SyntaxErrorKind, loc: L) -> SyntaxError { | 30 | pub fn new<L: Into<Location>>(kind: SyntaxErrorKind, loc: L) -> SyntaxError { |
31 | SyntaxError { kind, location: loc.into() } | 31 | SyntaxError { |
32 | kind, | ||
33 | location: loc.into(), | ||
34 | } | ||
32 | } | 35 | } |
33 | 36 | ||
34 | pub fn location(&self) -> Location { | 37 | pub fn location(&self) -> Location { |
@@ -45,7 +48,7 @@ impl SyntaxError { | |||
45 | pub fn add_offset(mut self, plus_offset: TextUnit) -> SyntaxError { | 48 | pub fn add_offset(mut self, plus_offset: TextUnit) -> SyntaxError { |
46 | self.location = match self.location { | 49 | self.location = match self.location { |
47 | Location::Range(range) => Location::Range(range + plus_offset), | 50 | Location::Range(range) => Location::Range(range + plus_offset), |
48 | Location::Offset(offset) => Location::Offset(offset + plus_offset) | 51 | Location::Offset(offset) => Location::Offset(offset + plus_offset), |
49 | }; | 52 | }; |
50 | 53 | ||
51 | self | 54 | self |