RS.CLIPPY.NO_EFFECT_REPLACE

Replace with no effect

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

What it does

Checks for replace statements which have no effect.

Why is this bad?

It's either a mistake or confusing.

Example

"1234".replace("12", "12");
"1234".replacen("12", "12", 1);