on-internet
← Community

Rust iterate over ChunkExactMut -> use of moved value

Stack Overflow ·

I'm trying to generate a simple test image but I get a "use of moved value" error. I think it is because the ChunkExactMut iterator does not implement Copy. But the step_by function should create a new iterator (Rust documentation). fn step_by(self, step: usize) -> StepBy<Self>ⓘ Creates an iterator starting at the same point, but stepping by the given amount at each iteration. What is the Rust way to write it? Or a good way. I thought usage of iterators would be a safer approach than a pointer or vec[index] = value implementation. /// generate bayer image with rg pattern fn generate_test_image

Comments

Sign in or sign up to comment and upvote.

No comments yet.