use uuid_1::Uuid;
use crate::{rancor::Fallible, CheckBytes};
unsafe impl<C: Fallible + ?Sized> CheckBytes<C> for Uuid {
#[inline]
unsafe fn check_bytes(_: *const Self, _: &mut C) -> Result<(), C::Error> {
Ok(())
}
}
#[cfg(test)]
mod tests {
use uuid_1::Uuid;
use crate::{check_bytes, rancor::Infallible};
#[test]
fn test_check_bytes() {
let uuid_str = "f9168c5e-ceb2-4faa-b6bf-329bf39fa1e4";
let u = Uuid::parse_str(uuid_str).unwrap();
unsafe {
check_bytes::<_, Infallible>(&u).expect("failed to check uuid");
}
}
}