Need Assistance?

support@tutorialshub.in

Iterators & Closures

Using fold & enumerate

ADVERTISEMENT
Rust Free Lesson
5 min read
ADVERTISEMENT

Use .enumerate() when you need both index and item, and .fold(init, |acc, x| ...) to reduce a collection into any accumulated result.

ADVERTISEMENT
Hi, I'm Tuby! Here to help you