RS.CLIPPY.ALMOST_SWAPPED

`foo = bar; bar = foo` sequence

This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: almost_swapped. Copyright ©2025 The Rust Team. All rights reserved.

What it does

Checks for foo = bar; bar = foo sequences.

Why is this bad?

This looks like a failed attempt to swap.

Example

a = b;
b = a;

If swapping is intended, use swap() instead:

std::mem::swap(&mut a, &mut b);