Function swap3::swap3_cab

source ·
pub fn swap3_cab<T>(a: &mut T, b: &mut T, c: &mut T)
Expand description

Rotates three values to the right.

§Arguments

  • a - The first value, to be assigned with the value of c.
  • b - The second value, to be assigned with the value of a.
  • c - The third value, to be assigned with the value of b.

§Example

let mut a = 10;
let mut b = 20;
let mut c = 30;
swap3::swap3_cab(&mut a, &mut b, &mut c);
assert_eq!([a, b, c], [30, 10, 20]);