3 ms·
The article skips directly from #4 to #6, so I'll nominate something for #5: ranges should not be iterators. Instead they should impl IntoIterator and the itera
by EscapeFromNY 3y ago
The article skips directly from #4 to #6, so I'll nominate something for #5: ranges should not be iterators. Instead they should impl IntoIterator and the iterators should be separate types. That way ranges can impl Copy without any issues. https://kaylynn.gay/blog/post/rust_ranges_and_suffering https://kaylynn.gay/blog/post/rust_ranges_and_suffering
- Ygg2 3y agoIt's a well known issue, but it might never be solved due to backwards compatibility. They were made non-Copy to avoid a nasty footgun, and way before IntoIterator existed.