Skip to content

Commit f352786

Browse files
committed
Fix clippy lints
1 parent 9cc3494 commit f352786

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clippy_lints/src/uninit_vec.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ impl<'tcx> LocalOrExpr<'tcx> {
9191
}
9292
}
9393

94-
/// Returns the target vec of Vec::with_capacity() or Vec::reserve()
94+
/// Returns the target vec of `Vec::with_capacity()` or `Vec::reserve()`
9595
fn extract_with_capacity_or_reserve_target(cx: &LateContext<'_>, stmt: &'tcx Stmt<'_>) -> Option<LocalOrExpr<'tcx>> {
9696
match stmt.kind {
9797
StmtKind::Local(local) => {
@@ -128,7 +128,7 @@ fn extract_with_capacity_or_reserve_target(cx: &LateContext<'_>, stmt: &'tcx Stm
128128
_ => None,
129129
}
130130
},
131-
_ => None,
131+
StmtKind::Item(_) => None,
132132
}
133133
}
134134

@@ -145,7 +145,7 @@ fn is_with_capacity(cx: &LateContext<'_>, expr: &'tcx Expr<'_>) -> bool {
145145
}
146146
}
147147

148-
/// Returns self if the expression is Vec::set_len()
148+
/// Returns self if the expression is `Vec::set_len()`
149149
fn extract_set_len_self(cx: &LateContext<'_>, expr: &'tcx Expr<'_>) -> Option<(&'tcx Expr<'tcx>, Span)> {
150150
// peel unsafe blocks in `unsafe { vec.set_len() }`
151151
let expr = peel_hir_expr_while(expr, |e| {

0 commit comments

Comments
 (0)