diff options
author | Aleksey Kladov <[email protected]> | 2019-02-08 11:49:43 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-02-08 11:49:43 +0000 |
commit | 12e3b4c70b5ef23b2fdfc197296d483680e125f9 (patch) | |
tree | 71baa0e0a62f9f6b61450501c5f821f67badf9e4 /crates/ra_syntax/src/yellow/syntax_error.rs | |
parent | 5cb1d41a30d25cbe136402644bf5434dd667f1e5 (diff) |
reformat the world
Diffstat (limited to 'crates/ra_syntax/src/yellow/syntax_error.rs')
-rw-r--r-- | crates/ra_syntax/src/yellow/syntax_error.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/crates/ra_syntax/src/yellow/syntax_error.rs b/crates/ra_syntax/src/yellow/syntax_error.rs index c52c44cc3..412cf82cc 100644 --- a/crates/ra_syntax/src/yellow/syntax_error.rs +++ b/crates/ra_syntax/src/yellow/syntax_error.rs | |||
@@ -28,10 +28,7 @@ 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 { | 31 | SyntaxError { kind, location: loc.into() } |
32 | kind, | ||
33 | location: loc.into(), | ||
34 | } | ||
35 | } | 32 | } |
36 | 33 | ||
37 | pub fn kind(&self) -> SyntaxErrorKind { | 34 | pub fn kind(&self) -> SyntaxErrorKind { |
@@ -119,10 +116,9 @@ impl fmt::Display for SyntaxErrorKind { | |||
119 | InvalidByteEscape => write!(f, "Invalid escape sequence"), | 116 | InvalidByteEscape => write!(f, "Invalid escape sequence"), |
120 | TooShortByteCodeEscape => write!(f, "Escape sequence should have two digits"), | 117 | TooShortByteCodeEscape => write!(f, "Escape sequence should have two digits"), |
121 | MalformedByteCodeEscape => write!(f, "Escape sequence should be a hexadecimal number"), | 118 | MalformedByteCodeEscape => write!(f, "Escape sequence should be a hexadecimal number"), |
122 | UnicodeEscapeForbidden => write!( | 119 | UnicodeEscapeForbidden => { |
123 | f, | 120 | write!(f, "Unicode escapes are not allowed in byte literals or byte strings") |
124 | "Unicode escapes are not allowed in byte literals or byte strings" | 121 | } |
125 | ), | ||
126 | TooShortAsciiCodeEscape => write!(f, "Escape sequence should have two digits"), | 122 | TooShortAsciiCodeEscape => write!(f, "Escape sequence should have two digits"), |
127 | AsciiCodeEscapeOutOfRange => { | 123 | AsciiCodeEscapeOutOfRange => { |
128 | write!(f, "Escape sequence should be between \\x00 and \\x7F") | 124 | write!(f, "Escape sequence should be between \\x00 and \\x7F") |