I'm working on a library for managing polygons in rust. I made a post on it on the subreddit and a suggestion was made to change the return points of some of the functions from Vectors to Iterators to add flexibility and avoid heap allocation. This is turning out to be a major headache as I want to keep everything as flexible as possible. At present the signatures look a little like this (I'm stripping out non relevant -> Self methods and a lof of the alias and derived methods, but this should give you an idea of the trouble.
I want to be able to return iterators, but at the moment it's looking impossible without either getting into lifetime management hell, having to fix the type in the signature which would limit how people can implement things. How would you go about doing this?
I don't know what are the priorities of the Rust core developers. But I think the partial type inference of the return type is a rather important feature if you want to reduce the number of useless allocations in range-intensive Rust programs.