Auto merge of #11430 - TDecking:vec-fmt, r=giraffate
Correctly format `vec!` invocations The [Rust Style Guide](https://doc.rust-lang.org/nightly/style-guide/expressions.html?highlight=vec#array-literals) says that `vec!` should alwys be used with square brackets, not parenthesis. Within the lint documentation, that rule was violated twice. changelog: none
This commit is contained in:
commit
c1f8ae3a4a
2 changed files with 3 additions and 3 deletions
|
|
@ -3055,12 +3055,12 @@ declare_clippy_lint! {
|
|||
///
|
||||
/// ### Example
|
||||
/// ```rust
|
||||
/// vec!(1, 2, 3, 4, 5).resize(0, 5)
|
||||
/// vec![1, 2, 3, 4, 5].resize(0, 5)
|
||||
/// ```
|
||||
///
|
||||
/// Use instead:
|
||||
/// ```rust
|
||||
/// vec!(1, 2, 3, 4, 5).clear()
|
||||
/// vec![1, 2, 3, 4, 5].clear()
|
||||
/// ```
|
||||
#[clippy::version = "1.46.0"]
|
||||
pub VEC_RESIZE_TO_ZERO,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue