use std::io::Read;
use std::mem::MaybeUninit;
#[cold]
#[inline(always)]
pub const fn cold_path() {}
#[expect(dead_code)]
#[inline(always)]
pub const fn likely(b: bool) -> bool {
if !b {
cold_path();
}
b
}
#[inline(always)]
pub const fn unlikely(b: bool) -> bool {
if b {
cold_path();
}
b
}
pub fn read_uninit_exact<R: Read>(
reader: &mut R,
buf: &mut [MaybeUninit<u8>],
) -> std::io::Result<()> {
let buf_ptr = buf.as_mut_ptr() as *mut u8;
let buf_slice = unsafe { std::slice::from_raw_parts_mut(buf_ptr, buf.len()) };
reader.read_exact(buf_slice)
}