Skip to content

Commit 62f40e2

Browse files
committed
Auto merge of #3706 - robamler:patch-1, r=phansch
Fix documentation for `slow_vector_initialization` This PR fixes the documentation for the lint `slow_vector_initialization`. The documentation recommended writing `vec![len; 0]` but the correct solution is `vec![0; len]`.
2 parents 13421e3 + 14e27f5 commit 62f40e2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_lints/src/slow_vector_initialization.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ use syntax_pos::symbol::Symbol;
1111

1212
/// **What it does:** Checks slow zero-filled vector initialization
1313
///
14-
/// **Why is this bad?** This structures are non-idiomatic and less efficient than simply using
15-
/// `vec![len; 0]`.
14+
/// **Why is this bad?** These structures are non-idiomatic and less efficient than simply using
15+
/// `vec![0; len]`.
1616
///
1717
/// **Known problems:** None.
1818
///

0 commit comments

Comments
 (0)