use a function rather than a closure

This commit is contained in:
Skgland
2026-04-30 19:02:27 +02:00
parent 48a34aa2cc
commit 327a677a7c

View File

@@ -135,7 +135,7 @@ impl<R: Read> CharRead for CharReader<R> {
Err(e) => return Some(Err(e)),
}
let bad_bytes_error = |buf: &[u8]| {
fn bad_bytes_error(buf: &[u8]) -> std::io::Error {
// If we have 4 bytes that still don't make up
// a valid code point, then we have garbage.