-
Notifications
You must be signed in to change notification settings - Fork 565
Open
Labels
Description
I see tuples() listed in Probably applicable but did not yet open issues
I'd find this very useful. I'm re-encoding images from LE-XRBG to BE-RGB:
let mmap: memmap2::Mmap = ...
let mut image_data = vec![0u8; mmap.len() * 3 / 4];
mmap.iter()
.tuples()
.zip(image_data.iter_mut().tuples())
.for_each(|((b, g, r, _), (r2, g2, b2))| (*r2, *g2, *b2) = (*r, *g, *b));This can clearly be parallelised quite a bit, but I don't see any obvious way of writing it without tuples().