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! {
/// **What it does:** Warns when using push_str with a single-character string literal,
/// and push with a char would work fine.
/// **What it does:** Warns when using `push_str` with a single-character string literal,
/// 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
///
/// **Example:**
/// ```
/// ```rust
/// let mut string = String::new();
/// string.push_str("R");
/// ```
/// Could be written as
/// ```
/// ```rust
/// let mut string = String::new();
/// string.push('R');
/// ```