// sorts through swapping the first value until it is at the right position, and repeating for all the following.
sorts through swapping the first value until it is at the right position, and repeating for all the following.
sorts through swapping the first value until it is at the right position and repeating for all the following .
pub fn exchange_sort(arr: &mut [i32]) {
    let length = arr.len();
    for number1 in 0..length {
        for number2 in (number1 + 1)..length {
            if arr[number2] < arr[number1] {
                arr.swap(number1, number2)
            }
        }
    }
}
pub fn exchange_sort ( arr : & mut [ i32 ] ) { let length = arr . len ( ) ; for number1 in 0 .. length { for number2 in ( number1 + 1 ) .. length { if arr [ number2 ] < arr [ number1 ] { arr . swap ( number1 , number2 ) } } } }
sorts through swapping the first value until it is at the right position, and repeating for all the following.
sorts through swapping the first value until it is at the right position and repeating for all the following .
arr
&mut [i32]