RS.CLIPPY.OP_REF

Taking a reference to satisfy the type constraints on `==`

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

What it does

Checks for arguments to == which have their address taken to satisfy a bound and suggests to dereference the other argument instead

Why is this bad?

It is more idiomatic to dereference the other argument.

Example

&x == y

Use instead:

x == *y