Hey,
I’m currently looking into implementing some specialized* SpecExtend impl’s for LinkedList.
*: https://github.com/rust-lang/rfcs/blob/master/text/1210-impl-specialization.md
What I’ve noticed and would like to check is: It’s currently only reasonable to implement specialization for iterator types which are defined in the same module.
For LinkedList, it’s conceivable that extend on DrainFilter would just relink the nodes drained from the iterator onto the list it’s being extended onto.
For linked_list::IntoIter, we can simply relink the end of one list to the beginning of another (which is really neat!).
But for the more exotic scenarios like:
list1.extend(list2.into_iter().skip_while(...).filter(...))
The type of this iterator wouldn’t match any of the specialized impls. At least as far as I’m able to express them.
Is this the case? If so, is it still worthwhile specializing some of the SpecExtend impl’s where possible?