Fix an incorrect comment.
If a `\x` escape occurs in a non-byte literals (e.g. char literal, string literal), it must be <= 0xff.
This commit is contained in:
@@ -184,7 +184,7 @@ fn scan_escape(chars: &mut Chars<'_>, mode: Mode) -> Result<char, EscapeError> {
|
|||||||
|
|
||||||
let value = hi * 16 + lo;
|
let value = hi * 16 + lo;
|
||||||
|
|
||||||
// For a byte literal verify that it is within ASCII range.
|
// For a non-byte literal verify that it is within ASCII range.
|
||||||
if !mode.is_bytes() && !is_ascii(value) {
|
if !mode.is_bytes() && !is_ascii(value) {
|
||||||
return Err(EscapeError::OutOfRangeHexEscape);
|
return Err(EscapeError::OutOfRangeHexEscape);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user