//! Utilities used internally by this crate. use crate::control::{from_u32, RawResourceHandle}; pub unsafe fn transmute_vec(from: Vec) -> Vec { let mut from = std::mem::ManuallyDrop::new(from); Vec::from_raw_parts(from.as_mut_ptr() as *mut U, from.len(), from.capacity()) } pub unsafe fn transmute_vec_from_u32>(raw: Vec) -> Vec { if cfg!(debug_assertions) { raw.into_iter() .map(|handle| from_u32(handle).unwrap()) .collect() } else { transmute_vec(raw) } }