Skip to content

Commit 4943142

Browse files
committed
Remove explicit \n and \t handling in unescape_str_common.
The fallback `_` case works for these chars, no need to treat them specially.
1 parent 1480496 commit 4943142

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

compiler/rustc_lexer/src/unescape.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,6 @@ where
350350
_ => scan_escape::<T>(&mut chars, mode),
351351
}
352352
}
353-
'\n' => Ok(b'\n'.into()),
354-
'\t' => Ok(b'\t'.into()),
355353
'"' => Err(EscapeError::EscapeOnlyChar),
356354
'\r' => Err(EscapeError::BareCarriageReturn),
357355
_ => ascii_check(c, mode.characters_should_be_ascii()).map(Into::into),

0 commit comments

Comments
 (0)