4 ms·
The first version isn't what I'd write in a purely functional language either, a recursive version would be much saner. Isn't recursion idiomatic in rust?
by lvass 4y ago
The first version isn't what I'd write in a purely functional language either, a recursive version would be much saner. Isn't recursion idiomatic in rust?
- steveklabnik 4y agoRust doesn't guarantee TCO and so recursion is a bit dicer than in many functional languages.
- throwaway894345 4y agoIn addition to Steve's sibling comment, I'm responding narrowly to iterators versus for-loops. Recursion is out of scope.