fn swap_2d_vec<T>(v: &mut Vec<Vec<T>>, pos1: (usize, usize), pos2: (usize, usize))
where
    T: Default,
{
    let mut temp = T::default();
    std::mem::swap(&mut v[pos1.0][pos1.1], &mut temp);
    std::mem::swap(&mut v[pos2.0][pos2.1], &mut temp);
    std::mem::swap(&mut v[pos1.0][pos1.1], &mut temp);
}
// swap two values in a vector
swap two values in a vector
swap two values in a vector
fn swap_2d_vec<T>(v: &mut Vec<Vec<T>>, pos1: (usize, usize), pos2: (usize, usize))
where
    T: Default,
{
    let mut temp = T::default();
    std::mem::swap(&mut v[pos1.0][pos1.1], &mut temp);
    std::mem::swap(&mut v[pos2.0][pos2.1], &mut temp);
    std::mem::swap(&mut v[pos1.0][pos1.1], &mut temp);
}
fn swap_2d_vec < T > ( v : & mut Vec < Vec < T > > , pos1 : ( usize , usize ) , pos2 : ( usize , usize ) ) where T : Default , { let mut temp = T :: default ( ) ; std :: mem :: swap ( & mut v [ pos1 . 0 ] [ pos1 . 1 ] , & mut temp ) ; std :: mem :: swap ( & mut v [ pos2 . 0 ] [ pos2 . 1 ] , & mut temp ) ; std :: mem :: swap ( & mut v [ pos1 . 0 ] [ pos1 . 1 ] , & mut temp ) ; }
swap two values in a vector
swap two values in a vector
v
&mut Vec<Vec<T>>
pos1
(usize, usize)
pos2
(usize, usize)
v
&mut Vec<Vec<T>>
pos1
(usize, usize)
pos2
(usize, usize)