4 ms·
It'll be fun when we get first-class generators and you can write a simple, imperative function and no helper types and still use this type signature :)
by wwright 6y ago
It'll be fun when we get first-class generators and you can write a simple, imperative function and no helper types and still use this type signature :)
- steveklabnik 6y agoUntil then, https://doc.rust-lang.org/stable/std/iter/fn.from_fn.html https://doc.rust-lang.org/stable/std/iter/fn.from_fn.html can handle many cases.
- brundolf 6y agoYeah, in my case I did code.chars().filter_map(...), where it returns a Some() at the end of each complete token. But generators would definitely be a little cleaner!