Expand description

Macro to extend core::mem::swap to n elements

Example usage:

// #[macro_use] extern crate swap_n;
use swap_n::swap_n;
     
let mut x = 1;
let mut y = 2;
let mut z = 3;

swap_n!(&mut x, &mut y, &mut z);

Examples of failure:

use swap_n::swap_n;

let mut x = 1;
swap_n!(&mut x);
use swap_n::swap_n;

let mut x = 1;
swap_n!(x);
use swap_n::swap_n;

let mut x = 1;
let mut y = 1.0;
swap_n!(&mut x, &mut y);

Macros