1
Fork 0

Re-format let-else per rustfmt update

This commit is contained in:
Mark Rousskov 2023-07-12 21:49:27 -04:00
parent 67b0cfc761
commit cc907f80b9
162 changed files with 1404 additions and 947 deletions

View file

@ -1683,12 +1683,16 @@ impl<'tcx> Liveness<'_, 'tcx> {
opt_body: Option<&hir::Body<'_>>,
) -> Vec<errors::UnusedVariableStringInterp> {
let mut suggs = Vec::new();
let Some(opt_body) = opt_body else { return suggs; };
let Some(opt_body) = opt_body else {
return suggs;
};
let mut visitor = CollectLitsVisitor { lit_exprs: vec![] };
intravisit::walk_body(&mut visitor, opt_body);
for lit_expr in visitor.lit_exprs {
let hir::ExprKind::Lit(litx) = &lit_expr.kind else { continue };
let rustc_ast::LitKind::Str(syb, _) = litx.node else{ continue; };
let rustc_ast::LitKind::Str(syb, _) = litx.node else {
continue;
};
let name_str: &str = syb.as_str();
let name_pa = format!("{{{name}}}");
if name_str.contains(&name_pa) {