3 ms·
Iterators are the main place this is difficult, but as steveklabnik says the compiler can tell you the return type. However, this will get better with the intr
by trishume 9y ago
Iterators are the main place this is difficult, but as steveklabnik says the compiler can tell you the return type.
However, this will get better with the introduction of "impl Trait", where the return type will become `impl Iterator<Item = (i64, &[i32])>` which while admittedly long is better than what you'd have otherwise. It's definitely a known pain point.
In practice writing Rust code (full time!) I don't encounter this issue much because I rarely want to split an iterator chain across multiple functions, and iterators are the main place the types get long and hairy. Although I've heard it's really bad with Futures, but that's why "impl Trait" is coming.