pub fn insertion_sort<T: PartialOrd + Clone>(src: &mut [T]) {
    for cur in 1..src.len() {
        let mut i = cur;
        while i > 0 && src[i] < src[i - 1] {
            src.swap(i, i - 1);
            i -= 1;
        }
    }
}
/// Insertion sort implementation.
///
/// Finds for `src[cur]` value it's place in sorted area (which is [0; cur)
/// by moving it to the left everytime there is a value bigger than it in the sorted area.
Insertion sort implementation.
Finds for `src[cur]` value it's place in sorted area (which is [0; cur)
by moving it to the left everytime there is a value bigger than it in the sorted area.
Insertion sort implementation . Finds for ` src [ cur ] ` value it ' s place in sorted area ( which is [ 0 ; cur ) by moving it to the left everytime there is a value bigger than it in the sorted area .
pub fn insertion_sort<T: PartialOrd + Clone>(src: &mut [T]) {
    for cur in 1..src.len() {
        let mut i = cur;
        while i > 0 && src[i] < src[i - 1] {
            src.swap(i, i - 1);
            i -= 1;
        }
    }
}
pub fn insertion_sort < T : PartialOrd + Clone > ( src : & mut [ T ] ) { for cur in 1 .. src . len ( ) { let mut i = cur ; while i > 0 && src [ i ] < src [ i - 1 ] { src . swap ( i , i - 1 ) ; i -= 1 ; } } }
Insertion sort implementation.
Insertion sort implementation .
src
&mut [T]
src
&mut [T]