Remove explicit \n and \t handling in unescape_str_common.

The fallback `_` case works for these chars, no need to treat them
specially.
This commit is contained in:
Nicholas Nethercote 2023-12-07 09:16:18 +11:00
parent 08b8ba0a32
commit f883762970

View file

@ -351,8 +351,6 @@ where
_ => scan_escape::<T>(&mut chars, mode),
}
}
'\n' => Ok(b'\n'.into()),
'\t' => Ok(b'\t'.into()),
'"' => Err(EscapeError::EscapeOnlyChar),
'\r' => Err(EscapeError::BareCarriageReturn),
_ => ascii_check(c, mode.characters_should_be_ascii()).map(Into::into),