I have some sample code on the playground that demonstrates my best effort to implement Iterator, IntoIterator and FromIterator on a struct that contains a Vec. I included both a non-generic and a generic version: Rust Playground
Can someone please look over it and tell me if this code matches up with best practices or if there can be improvements? For example, I have looked over other tutorials like YARIT: Yet Another Rust Iterators Tutorial - DEV Community 👩💻👨💻 which use std::slice::Iter which I think might be more efficient than my approach but I have been unable to get that to compile.
I created a new playground post: Rust Playground
This one does not compile but is my best effort at a non-generic non-consuming Iterator. I am relatively new to rust and I think my problem boils down to lifetime references but I am unsure how to solve it. Any help would be appreciated.
Here's a version that compiles, I didn't modify much, mostly added/removed lifetimes.
I just removed DogVecIter.inner since it wasn't used, so this type could become a newtype, I left it like this in case you need inner in your real code.