At first I thought: you could just use cmp instead of partial_cmp.unwrap but then at the second look, why don't you just use sort_by_key (or better sort_unstable_key_by which will improve performance for large slices because of the underlying sorting algorithmn)
https://github.com/iolivia/rust-sokoban/blob/5e1ac13664d739c21af680fa7fa63b690f53aa92/code/rust-sokoban-c01-04/src/main.rs#L65
At first I thought: you could just use
cmp
instead ofpartial_cmp.unwrap
but then at the second look, why don't you just usesort_by_key
(or bettersort_unstable_key_by
which will improve performance for large slices because of the underlying sorting algorithmn)