I'm not sure I understand the criticism. Presumably you're *not* criticizing the the one in the original post – the one that wasn't recognized as selection sort?

If you are referring to the example I wrote above, I completely understand that style is unfamiliar to some and an immediate turn-off. However, it was written to actually *read like* the description of the Selection Sort algorithm (bullets are mine to emphasize the 3 steps):

The algorithm proceeds by

- finding the smallest (or largest, depending on sorting order) element in the unsorted sublist,
- exchanging (swapping) it with the leftmost unsorted element (putting it in sorted order), and
- moving the sublist boundaries one element to the right.

Those are *exactly* the 3 lines I wrote above. In this form, it doesn't require complicated reasoning about the presence of off-by-one errors, which I often have to do with in-place sorts written in the style I would in C.

Perhaps this slightly modified version emphasizes a bit better that the first line computes the index of the min.

```
fn selection_sort(mut array: &mut [u32]) {
// Instead of an index going through the array,
// we will keep shrinking the array slice down
// to its unsorted portion.
while array.len() > 0 {
let index_of_min = array
.iter().copied().enumerate()
.min_by_key(|&(_index, val)| val)
.map(|(index, _val)| index);
if let Some(index_of_min) = index_of_min {
array.swap(0, index_of_min);
}
array = &mut array[1..];
}
}
```

Playground