diff options
author | Adolfo OchagavĂa <[email protected]> | 2018-11-05 21:29:33 +0000 |
---|---|---|
committer | Adolfo OchagavĂa <[email protected]> | 2018-11-05 21:29:33 +0000 |
commit | 59405bfe4ad0afa0b7ff533c7bfbc3ad4170604c (patch) | |
tree | 7fd21d42603420b53c4096180888d68bcf0b26ae /crates/ra_syntax/src/yellow | |
parent | fda8ddc5fe8a764c0dc91fecb92af1bdf3078485 (diff) |
cargo format
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 |