Syntax-highlight single_char_push_str lint

This commit is contained in:
Camelid
2020-08-30 11:24:15 -07:00
committed by Camelid
parent c88c614941
commit 17b2ba5ded

View File

@@ -1324,20 +1324,20 @@ declare_clippy_lint! {
} }
declare_clippy_lint! { declare_clippy_lint! {
/// **What it does:** Warns when using push_str with a single-character string literal, /// **What it does:** Warns when using `push_str` with a single-character string literal,
/// and push with a char would work fine. /// and `push` with a `char` would work fine.
/// ///
/// **Why is this bad?** It's less clear that we are pushing a single character /// **Why is this bad?** It's less clear that we are pushing a single character.
/// ///
/// **Known problems:** None /// **Known problems:** None
/// ///
/// **Example:** /// **Example:**
/// ``` /// ```rust
/// let mut string = String::new(); /// let mut string = String::new();
/// string.push_str("R"); /// string.push_str("R");
/// ``` /// ```
/// Could be written as /// Could be written as
/// ``` /// ```rust
/// let mut string = String::new(); /// let mut string = String::new();
/// string.push('R'); /// string.push('R');
/// ``` /// ```