prefer-tuple-swap Prefer tuple assignment for swaps Swapping two places through a temporary spreads one parallel assignment across three statements. Instead, you SHOULD assign the reversed tuple directly to both places. - Category: style - Level: warning - Fix: suggestion - Scope: module Reported function swap(left: int32, right: int32): (int32, int32) { let first = left; let second = right; const temporary = first; first = second; second = temporary; return (first, second); } Accepted function swap(left: int32, right: int32): (int32, int32) { let first = left; let second = right; (first, second) = (second, first); return (first, second); } Prior art - Clippy ยท manualswap language/linter/src/rules/style/prefertupleswap.rs:8