Bump rustc-literal-escaper

This commit is contained in:
Laurențiu Nicola 2025-07-21 09:27:37 +03:00
parent 30333a637c
commit 9f3adc540b
3 changed files with 6 additions and 12 deletions

View file

@ -309,8 +309,8 @@ impl ast::CString {
let mut prev_end = 0;
let mut has_error = None;
let extend_unit = |buf: &mut Vec<u8>, unit: MixedUnit| match unit {
MixedUnit::Char(c) => buf.extend(c.encode_utf8(&mut [0; 4]).as_bytes()),
MixedUnit::HighByte(b) => buf.push(b),
MixedUnit::Char(c) => buf.extend(c.get().encode_utf8(&mut [0; 4]).as_bytes()),
MixedUnit::HighByte(b) => buf.push(b.get()),
};
unescape_c_str(text, |char_range, unescaped| match (unescaped, buf.capacity() == 0) {
(Ok(u), false) => extend_unit(&mut buf, u),