diff options
Diffstat (limited to 'src/tools/clippy/src/docs/non_ascii_literal.txt')
-rw-r--r-- | src/tools/clippy/src/docs/non_ascii_literal.txt | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/non_ascii_literal.txt b/src/tools/clippy/src/docs/non_ascii_literal.txt new file mode 100644 index 000000000..164902b47 --- /dev/null +++ b/src/tools/clippy/src/docs/non_ascii_literal.txt @@ -0,0 +1,19 @@ +### What it does +Checks for non-ASCII characters in string and char literals. + +### Why is this bad? +Yeah, we know, the 90's called and wanted their charset +back. Even so, there still are editors and other programs out there that +don't work well with Unicode. So if the code is meant to be used +internationally, on multiple operating systems, or has other portability +requirements, activating this lint could be useful. + +### Example +``` +let x = String::from("€"); +``` + +Use instead: +``` +let x = String::from("\u{20ac}"); +```
\ No newline at end of file |