use core::{mem, ptr};
use num::Num;
use std::cmp::min;

pub fn swap_loop<T>(a: &mut [T], b: &mut [T]) {
    for (x, y) in a.iter_mut().zip(b.iter_mut()) {
        mem::swap(x, y);
    }
}

pub fn swap_ptrswap<T>(a: &mut [T], b: &mut [T]) {
    unsafe { ptr::swap_nonoverlapping(a.as_mut_ptr(), b.as_mut_ptr(), min(a.len(), b.len())) }
}

/// Exactly equivalent to `swap_2`, but trades the use of unsafe operations against having to know
/// the exact type and size of the vector at compile time.  Only works with `heapless::Vec`.
pub fn swap_3<T, N>(a: &mut heapless::Vec<T, N>, b: &mut heapless::Vec<T, N>)
where
    N: heapless::ArrayLength<T>,
    T: Num + Copy,
{
    mem::swap(a, b);
}
