3 ms·
Thanks! I just thought their might be some quite important technical reasons for this decision. After all overloading the return type is quite usual and extrem
by dan00 10y ago
Thanks! I just thought their might be some quite important technical reasons for this decision.
After all overloading the return type is quite usual and extremly helpful for parsing or the conversion of types.
But these kind of operations most likely will be done with a Trait in Rust, so having this option for closures might not be that important.
- Manishearth 10y agoExactly -- it only stops you from creating function-likes that have multiple return types (not closures, because closures aren't locally generic anyway). If you really need such behavior, regular generic functions or traits will work, e.g. `.collect()`