RS.CLIPPY.NEG_MULTIPLY

Multiplying integers by `-1`

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

What it does

Checks for multiplication by -1 as a form of negation.

Why is this bad?

It's more readable to just negate.

Example

let a = x * -1;

Use instead:

let a = -x;