
// use std::fmt::Debug;

// pub fn insertion_sort<T: Debug>(array: &mut Vec<T>) {
pub fn insertion_sort(array: &mut Vec<f64>) {
    let n = array.len();

    if n > 1 {
        println!("  simplesorts::insertion_sort():  N = {:?}", n);
        for (i,elem) in array.iter().enumerate() {
            println!("    simplesorts::insertion_sort():  i={}   {:?}", i, elem);
        }
    }
}


use std::fmt::Debug;

pub fn insertion_sort<T: Clone + Debug>(input: &[T]) -> &[T] {
    let n = input.len();

    let output = input.clone();

    println!("  simplesorts::insertion_sort():  n = {:?}", n);
    println!("  simplesorts::insertion_sort():  input:  {:?}", input);
    println!("  simplesorts::insertion_sort():  output: {:?}", output);

    for (i,elem) in input.iter().enumerate() {
        println!("    simplesorts::insertion_sort():  i={}   {:?}", i, elem);
    }

    return output;
}

Use slices for input and output
Use slices for input and output
