diff options
Diffstat (limited to 'clippy_lints/src/unicode.rs')
| -rw-r--r-- | clippy_lints/src/unicode.rs | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/clippy_lints/src/unicode.rs b/clippy_lints/src/unicode.rs index c31a8aebc35..4d9e2f18650 100644 --- a/clippy_lints/src/unicode.rs +++ b/clippy_lints/src/unicode.rs @@ -6,53 +6,53 @@ use syntax::ast::LitKind; use syntax::source_map::Span; use unicode_normalization::UnicodeNormalization; -/// **What it does:** Checks for the Unicode zero-width space in the code. -/// -/// **Why is this bad?** Having an invisible character in the code makes for all -/// sorts of April fools, but otherwise is very much frowned upon. -/// -/// **Known problems:** None. -/// -/// **Example:** You don't see it, but there may be a zero-width space -/// somewhere in this text. declare_clippy_lint! { + /// **What it does:** Checks for the Unicode zero-width space in the code. + /// + /// **Why is this bad?** Having an invisible character in the code makes for all + /// sorts of April fools, but otherwise is very much frowned upon. + /// + /// **Known problems:** None. + /// + /// **Example:** You don't see it, but there may be a zero-width space + /// somewhere in this text. pub ZERO_WIDTH_SPACE, correctness, "using a zero-width space in a string literal, which is confusing" } -/// **What it does:** Checks for non-ASCII characters in string 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. -/// -/// **Known problems:** None. -/// -/// **Example:** -/// ```rust -/// let x = "Hä?" -/// ``` declare_clippy_lint! { + /// **What it does:** Checks for non-ASCII characters in string 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. + /// + /// **Known problems:** None. + /// + /// **Example:** + /// ```rust + /// let x = "Hä?" + /// ``` pub NON_ASCII_LITERAL, pedantic, "using any literal non-ASCII chars in a string literal instead of using the `\\u` escape" } -/// **What it does:** Checks for string literals that contain Unicode in a form -/// that is not equal to its -/// [NFC-recomposition](http://www.unicode.org/reports/tr15/#Norm_Forms). -/// -/// **Why is this bad?** If such a string is compared to another, the results -/// may be surprising. -/// -/// **Known problems** None. -/// -/// **Example:** You may not see it, but “à” and “à” aren't the same string. The -/// former when escaped is actually `"a\u{300}"` while the latter is `"\u{e0}"`. declare_clippy_lint! { + /// **What it does:** Checks for string literals that contain Unicode in a form + /// that is not equal to its + /// [NFC-recomposition](http://www.unicode.org/reports/tr15/#Norm_Forms). + /// + /// **Why is this bad?** If such a string is compared to another, the results + /// may be surprising. + /// + /// **Known problems** None. + /// + /// **Example:** You may not see it, but “à” and “à” aren't the same string. The + /// former when escaped is actually `"a\u{300}"` while the latter is `"\u{e0}"`. pub UNICODE_NOT_NFC, pedantic, "using a unicode literal not in NFC normal form (see [unicode tr15](http://www.unicode.org/reports/tr15/) for further information)" |
