diff options
| author | Yechan Bae <yechan@gatech.edu> | 2021-09-17 03:27:31 -0400 |
|---|---|---|
| committer | Yechan Bae <yechan@gatech.edu> | 2021-10-09 05:38:19 -0400 |
| commit | b8ba7269cd10843e4aebf855c4f72e980a9c0ed6 (patch) | |
| tree | 4f0d43ce7bc698f890291bd95b9e91d8f9122d69 | |
| parent | 452181c69d2a106d9d5a1262b69e68a765c4b3e3 (diff) | |
| download | rust-b8ba7269cd10843e4aebf855c4f72e980a9c0ed6.tar.gz rust-b8ba7269cd10843e4aebf855c4f72e980a9c0ed6.zip | |
Fix clippy lints
| -rw-r--r-- | clippy_lints/src/uninit_vec.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clippy_lints/src/uninit_vec.rs b/clippy_lints/src/uninit_vec.rs index ff302289a1f..8b1254b60f9 100644 --- a/clippy_lints/src/uninit_vec.rs +++ b/clippy_lints/src/uninit_vec.rs @@ -91,7 +91,7 @@ impl<'tcx> LocalOrExpr<'tcx> { } } -/// Returns the target vec of Vec::with_capacity() or Vec::reserve() +/// Returns the target vec of `Vec::with_capacity()` or `Vec::reserve()` fn extract_with_capacity_or_reserve_target(cx: &LateContext<'_>, stmt: &'tcx Stmt<'_>) -> Option<LocalOrExpr<'tcx>> { match stmt.kind { StmtKind::Local(local) => { @@ -128,7 +128,7 @@ fn extract_with_capacity_or_reserve_target(cx: &LateContext<'_>, stmt: &'tcx Stm _ => None, } }, - _ => None, + StmtKind::Item(_) => None, } } @@ -145,7 +145,7 @@ fn is_with_capacity(cx: &LateContext<'_>, expr: &'tcx Expr<'_>) -> bool { } } -/// Returns self if the expression is Vec::set_len() +/// Returns self if the expression is `Vec::set_len()` fn extract_set_len_self(cx: &LateContext<'_>, expr: &'tcx Expr<'_>) -> Option<(&'tcx Expr<'tcx>, Span)> { // peel unsafe blocks in `unsafe { vec.set_len() }` let expr = peel_hir_expr_while(expr, |e| { |
