Macro aoko::swap_mut[][src]

macro_rules! swap_mut {
    ($a : ident, $b : ident) => { ... };
}
Expand description

Swaps two variables’ value.

Principles

Shadowing by two mutable variables.

Examples

use aoko::swap_mut;
 
let (foo, bar) = ('a', 'b');
swap_mut!(foo, bar);
assert_eq!(('b', 'a'), (foo, bar));
 
foo = 'x';
bar = 'y';
assert_eq!(('x', 'y'), (foo, bar));