Skip to content

Commit

Permalink
Syntax-highlight single_char_push_str lint
Browse files Browse the repository at this point in the history
  • Loading branch information
camelid committed Aug 30, 2020
1 parent c88c614 commit 17b2ba5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions clippy_lints/src/methods/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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');
/// ```
Expand Down

0 comments on commit 17b2ba5

Please sign in to comment.