use crate::swapper::Swapper;

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

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

pub struct PtrSwapper {}
impl Swapper for PtrSwapper {
    fn swap<T>(a: &mut [T], b: &mut [T]) {
        unsafe { ptr::swap_nonoverlapping(a.as_mut_ptr(), b.as_mut_ptr(), min(a.len(), b.len())) }
    }
}
