iter() takes a bunch of values which are spread across space, and spreads them across time. collect() does the reverse: it takes values spread across time, and spreads them across space.
A note for viewers: Dan is showing you the brute force way of writing an Iterator for the Fibonacci function, which is important for understanding what an Iterator is. But when you need to write one yourself, there are helper functions that make things easier in many cases: github.com/rust-itertools/itertools/issues/430
very nice explanation, new Rustacean and having someone explain this clear and concise was a GOD SEND for my project
iter() takes a bunch of values which are spread across space, and spreads them across time.
collect() does the reverse: it takes values spread across time, and spreads them across space.
A note for viewers: Dan is showing you the brute force way of writing an Iterator for the Fibonacci function, which is important for understanding what an Iterator is. But when you need to write one yourself, there are helper functions that make things easier in many cases:
github.com/rust-itertools/itertools/issues/430
That was a great concise explanation. Thank you!
Thank you. Clear and crisp
Great stuff, you've just earned a sub. Keep the content coming! (: