See this question , its quite similar but not spesific language.
Some time ago I researched this topic (using C, but also applies to Rust).
In addition to converting to vector and sorting, then converting back to a linked list. Merge-sort is usually the best method for sorting a linked list.
The same method can be used for both double and single linked lists (there is no advantage to having links in both directions).
Here is an example from this answer , which I ported to C.
This is a good example of merge-sort, but after some further research, I found Mono eglib mergesort more efficient, especially when the list is already partially sorted.
Here is the portable version .
It's not too complicated to port this from C to Rust.
source share