Skip to content

Commit c9e0f09

Browse files
lolbinarycatLFS6502
authored andcommitted
fmt
1 parent f3daf63 commit c9e0f09

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

compiler/rustc_parse/src/lexer/unescape_error_reporting.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,12 @@ pub(crate) fn emit_unescape_error(
159159
version control settings",
160160
);
161161
} else if looks_like_quote(c) {
162-
diag.help(
163-
format!("{ec} is not an ascii quote, \
162+
diag.help(format!(
163+
"{ec} is not an ascii quote, \
164164
but may look like one in some fonts.\n\
165165
consider writing it in its \
166-
escaped form for clarity."));
166+
escaped form for clarity."
167+
));
167168
} else {
168169
if mode == Mode::Str || mode == Mode::Char {
169170
diag.span_suggestion(
@@ -310,14 +311,8 @@ fn looks_like_quote(c: char) -> bool {
310311
// ?c wdt:P4213 ?u.
311312
// }
312313
match c {
313-
'\u{2033}' |
314-
'\u{02BA}' |
315-
'\u{02DD}' |
316-
'\u{030B}' |
317-
'\u{030E}' |
318-
'\u{05F4}' |
319-
'\u{201C}' |
320-
'\u{201D}' => true,
314+
'\u{2033}' | '\u{02BA}' | '\u{02DD}' | '\u{030B}' | '\u{030E}' | '\u{05F4}'
315+
| '\u{201C}' | '\u{201D}' => true,
321316
_ => false,
322317
}
323318
}

0 commit comments

Comments
 (0)