mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-26 04:17:21 +00:00
Syntax-highlight single_char_push_str
lint
This commit is contained in:
parent
c88c614941
commit
17b2ba5ded
1 changed files with 5 additions and 5 deletions
|
@ -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');
|
||||
/// ```
|
||||
|
|
Loading…
Add table
Reference in a new issue