Since slice::sort and related functions like slice::sort_by_key may allocate "temporary storage half the size of self", it's possible to end up with a panic on allocation failure even when using TryVec.
Though sort_unstable and the unstable variants of the other sorting methods don't allocate, sometimes a stable sort is required. Perhaps adding a TrySort trait that provides fallible alternatives to these methods would be worthwhile.
Since
slice::sort
and related functions likeslice::sort_by_key
may allocate "temporary storage half the size ofself
", it's possible to end up with a panic on allocation failure even when usingTryVec
.Though
sort_unstable
and the unstable variants of the other sorting methods don't allocate, sometimes a stable sort is required. Perhaps adding aTrySort
trait that provides fallible alternatives to these methods would be worthwhile.