Remove redundant code in parse_codepoint

This commit is contained in:
Johannes Altmanninger
2025-04-14 21:50:51 +02:00
parent c740c656a8
commit a63633edea

View File

@@ -1019,15 +1019,15 @@ fn parse_codepoint(
return ControlFlow::Continue(true);
}
let mut codepoint = u32::from(res);
let sz = unsafe {
match unsafe {
mbrtowc(
std::ptr::addr_of_mut!(codepoint),
std::ptr::addr_of!(read_byte).cast(),
1,
state,
)
} as isize;
match sz {
} as isize
{
-1 => {
FLOG!(reader, "Illegal input");
*consumed += 1;
@@ -1038,12 +1038,6 @@ fn parse_codepoint(
// Sequence not yet complete.
return ControlFlow::Continue(false);
}
0 => {
// Actual nul char.
*consumed += 1;
out_seq.push('\0');
return ControlFlow::Continue(true);
}
_ => (),
}
if let Some(res) = char::from_u32(codepoint) {