Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is wrong, repeat(0) gives you a Repeat which will repeat 0 forever, that's its purpose:

https://play.rust-lang.org/?version=stable&mode=debug&editio...

This example makes a repeat(0) but asks for just the first 12 things in it, they are, of course, all twelve zeroes. Feel free to adjust it to ask for more if you think maybe there aren't any more, or they stop being zero.



Shit, I should not post in the morning before my first coffee :(




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: