rust-lang / rust-clippy

A bunch of lints to catch common mistakes and improve your Rust code. Book: https://doc.rust-lang.org/clippy/
https://rust-lang.github.io/rust-clippy/
Other
11.24k stars 1.51k forks source link

Warn about yen signs (¥) or won signs (₩) followed by an escape character #7964

Open KamilaBorowska opened 2 years ago

KamilaBorowska commented 2 years ago

What it does

Warns about U+00A5 or U+20A9 followed by an escape character (x, n, r, t, u, 0) or itself.

Categories (optional)

Doing so suggests the intent to actually use U+005C (\) instead. When using Windows in Japanese locale, U+005C is rendered as a Yen sign. When using Windows in Korean locale, U+005C is rendered as a won sign.

Drawbacks

None.

Example

print!("Hello¥n");

Could be written as:

print!("Hello\u{A5}n");

or what was probably intended:

print!("Hello\n");
KamilaBorowska commented 1 year ago

Examples of violations: