Skip to content

Commit

Permalink
Fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
Qwaz committed Oct 9, 2021
1 parent 452181c commit b8ba726
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions clippy_lints/src/uninit_vec.rs
Expand Up @@ -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) => {
Expand Down Expand Up @@ -128,7 +128,7 @@ fn extract_with_capacity_or_reserve_target(cx: &LateContext<'_>, stmt: &'tcx Stm
_ => None,
}
},
_ => None,
StmtKind::Item(_) => None,
}
}

Expand All @@ -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| {
Expand Down

0 comments on commit b8ba726

Please sign in to comment.