Is this realistically beneficial at all compared to just a map iterator that converts?
⚓ Rust 📅 2026-05-23 👤 surdeus 👁️ 1let mut temp_vec = ManuallyDrop::new(iter.collect::<Vec<u32>>());
unsafe {
Vec::from_raw_parts(
temp_vec.as_mut_ptr() as *mut [u32; 3],
temp_vec.len() / 3,
temp_vec.capacity() / 3,
)
}
4 posts - 3 participants
🏷️ Rust_feed