4 ms·
This is long with a lot of detail, but to me the key bit of information is: iterators (as expressed by Rust's Iterator trait) have some noticeable drawbacks. N
by haberman 12y ago
This is long with a lot of detail, but to me the key bit of information is: iterators (as expressed by Rust's Iterator trait) have some noticeable drawbacks. Notably, you can't delete while iterating.
However, a different abstraction called Cursors can accommodate this. I asked recently: "does this mean iterators are broken, or are iterators vs. cursors more of a fundamental tradeoff?" I got this very helpful answer in reply: http://www.reddit.com/r/rust/comments/2mkra1/impressions_after_writing_a_little_rust/cm58heh http://www.reddit.com/r/rust/comments/2mkra1/impressions_aft...