RS.CLIPPY.UNNECESSARY_OWNED_EMPTY_STRINGS

Detects cases of references to owned empty strings being passed as an argument to a function expecting `&str`

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

What it does

Detects cases of owned empty strings being passed as an argument to a function expecting &str

Why is this bad?

This results in longer and less readable code

Example

vec!["1", "2", "3"].join(&String::new());

Use instead:

vec!["1", "2", "3"].join("");