Why `Splice` doesn't implement `FusedIterator`?

I am not good at English. Sorry if there are any funny expressions.


std::vec::Splice does not implement FusedIterator. But Why?
This iterator generates the values to be deleted from the vector.
I wonder that the deletion targets of mutable-referenced collections don't appear later?

Now, I'm creating a custom type similar to Splice.
So, I need criteria for determining whether to mark it with FusedIterator.


I tried thinking about it myself as follows, but I hit a wall.
Vec<T>::splice method that returns a Splice is pretty complex...
The behavior of deletion and registration when dropping Splice is bit tricky.
Could that be the reason? Hmm..., I just don't get it.

Might be an oversight. Splice's Iterator implementation forwards to the underlying Drain's Iterator implementation, with Drain being a FusedIterator. So I'd say Splice can be marked as FusedIterator, too. I dug a bit and found the PRs for Splice and FusedIterator, for more context on the implementation history:

2 Likes

Oversight?

I never considered that possibility at all.
Sadly, it's usually me who's wrong.

Anyway, thank you very much.
Now I can safely add FusedIterator to my own type.