Syntax-highlight single_char_push_str lint
This commit is contained in:
@@ -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');
|
||||||
/// ```
|
/// ```
|
||||||
|
|||||||
Reference in New Issue
Block a user