Skip to main content
Log in

Mojo function

swap

swap[T: Movable](mut lhs: T, mut rhs: T)

Swaps the two given arguments.

Parameters:

  • T (Movable): Constrained to Movable types.

Args:

  • lhs (T): Argument value swapped with rhs.
  • rhs (T): Argument value swapped with lhs.