It would be nice to have a way to splice a LinkedList into another LinkedList via mutable reference. The use case is that I have 2 structs, each of which contain a LinkedList, and I would like to transfer all the elements from one LinkedList into the other.
Unfortunately, since both splice_before and splice_after take the other list by value and not by mutable reference, I have to work around it with mem::replace:
It would be nice to have a way to splice a
LinkedList
into anotherLinkedList
via mutable reference. The use case is that I have 2 structs, each of which contain aLinkedList
, and I would like to transfer all the elements from oneLinkedList
into the other.Unfortunately, since both
splice_before
andsplice_after
take the other list by value and not by mutable reference, I have to work around it withmem::replace
:This feels a bit hacky and it would be nice if
CursorMut
providedsplice_*
methods that took the other list by mutable reference.