use unicode_normalization::UnicodeNormalization;
declare_clippy_lint! {
- /// **What it does:** Checks for invisible Unicode characters in the code.
+ /// ### What it does
+ /// Checks for invisible Unicode characters in the code.
///
- /// **Why is this bad?** Having an invisible character in the code makes for all
+ /// ### 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 or soft hyphen
+ /// ### Example
+ /// You don't see it, but there may be a zero-width space or soft hyphen
/// somewhere in this text.
pub INVISIBLE_CHARACTERS,
correctness,
}
declare_clippy_lint! {
- /// **What it does:** Checks for non-ASCII characters in string literals.
+ /// ### 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
+ /// ### 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:**
+ /// ### Example
/// ```rust
/// let x = String::from("€");
/// ```
}
declare_clippy_lint! {
- /// **What it does:** Checks for string literals that contain Unicode in a form
+ /// ### 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
+ /// ### 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
+ /// ### 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,