Selection sort algorithm in Rust
You could use min_by_key to find the minimum's index and the method swap defined in slices: 

fn selection_sort(array: &amp;mut [i32]) {
    let len = array.len();
    for i in 0..len {
        let min = (i..len).min_by_key(|x| array[*x])
                          .unwrap();
        array.swap(min, i);
    }
}