Rust

Rust

Made by DeepSource

Found single-character string literal pattern RS-P1100

Performance
Major

Certain str functions, such as .split() and .find() work on patterns that accept both string literals as well as characters. When using such functions, prefer chars over single-character string literals as they are more performant.

Replace the single-character string literal with a char.

Bad practice

let x = "hello, world";
x.find("o"); // single-character str

Recommended

let x = "hello, world";
x.find('o'); // use a char instead