bubblesort-ifyer 0.2.0

Sorts stuff using Bubblesort!
Documentation
/// Sorts stuff_to_sort using the bubblesort algorithom and returns it
/// Behaviur with nan and and infinity and negative 0 is undefined
/// Behaviour when version != 1 && version != 255 && version != 254 is undefined
/// Recursiveness decicides how efficent the program is with 0 being the most efficent. However currently recursiveness must be None.
use sorted_ifyer::is_sorted;
pub fn bubblesort<T: std::clone::Clone + std::cmp::PartialOrd>(
    stuff_to_sort: &[T],
    version: u128,
    recursiveness: u128,
) -> Vec<T> {
    if version != 1 && version != 255 && version != 254 {
        panic!("28990985 version not supported")
    }
    let mut sorted_stuff = stuff_to_sort.to_vec();
    if sorted_stuff.is_empty() {
        return sorted_stuff;
    }
    let mut lowest_sorted = stuff_to_sort.len() - 1;
    while !is_sorted(stuff_to_sort, lowest_sorted + 1, recursiveness, 0) {
        for i in 1..=lowest_sorted {
            if sorted_stuff[i - 1] > sorted_stuff[i] {
                sorted_stuff.swap(i - 1, i);
            }
            if i == lowest_sorted {
                lowest_sorted -= 1
            }
        }
    }
    sorted_stuff
}