Want for intermediate Rust book / docs: a clean cut tutorial on how to implement the Iterator trait. Took a while to figure out that for many cases we need to create a secondary struct that holds / borrows the primary struct and adds a counter / lifetimes. This isn't documented.
-
-
Oh like overloaded traits for std types? Because Rust does not have specialization (yet soundness issues) so you'd have to do some type system trickery or cerate a wrapper type to get that.
-
More like replacing the default implementations. For example `Iterator.last()` can easily be optimized to not do a full traversal of the structure. There's probably a lot of these around. https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.last …
- 5 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.