Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos of author lint #12855

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clippy_lints/src/utils/author.rs
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ impl<'a, 'tcx> PrintVisitor<'a, 'tcx> {
match stmt.value.kind {
StmtKind::Let(local) => {
bind!(self, local);
kind!("Local({local})");
kind!("Let({local})");
self.option(field!(local.init), "init", |init| {
self.expr(init);
});
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/author.stdout
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if let StmtKind::Local(local) = stmt.kind
if let StmtKind::Let(local) = stmt.kind
&& let Some(init) = local.init
&& let ExprKind::Cast(expr, cast_ty) = init.kind
&& let TyKind::Path(ref qpath) = cast_ty.kind
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/author/blocks.stdout
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
if let ExprKind::Block(block, None) = expr.kind
&& block.stmts.len() == 3
&& let StmtKind::Local(local) = block.stmts[0].kind
&& let StmtKind::Let(local) = block.stmts[0].kind
&& let Some(init) = local.init
&& let ExprKind::Lit(ref lit) = init.kind
&& let LitKind::Int(42, LitIntType::Signed(IntTy::I32)) = lit.node
&& let PatKind::Binding(BindingMode::NONE, _, name, None) = local.pat.kind
&& name.as_str() == "x"
&& let StmtKind::Local(local1) = block.stmts[1].kind
&& let StmtKind::Let(local1) = block.stmts[1].kind
&& let Some(init1) = local1.init
&& let ExprKind::Lit(ref lit1) = init1.kind
&& let LitKind::Float(_, LitFloatType::Suffixed(FloatTy::F32)) = lit1.node
Expand All @@ -22,7 +22,7 @@ if let ExprKind::Block(block, None) = expr.kind
}
if let ExprKind::Block(block, None) = expr.kind
&& block.stmts.len() == 1
&& let StmtKind::Local(local) = block.stmts[0].kind
&& let StmtKind::Let(local) = block.stmts[0].kind
&& let Some(init) = local.init
&& let ExprKind::Call(func, args) = init.kind
&& let ExprKind::Path(ref qpath) = func.kind
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/author/call.stdout
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if let StmtKind::Local(local) = stmt.kind
if let StmtKind::Let(local) = stmt.kind
&& let Some(init) = local.init
&& let ExprKind::Call(func, args) = init.kind
&& let ExprKind::Path(ref qpath) = func.kind
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/author/if.stdout
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if let StmtKind::Local(local) = stmt.kind
if let StmtKind::Let(local) = stmt.kind
&& let Some(init) = local.init
&& let ExprKind::If(cond, then, Some(else_expr)) = init.kind
&& let ExprKind::DropTemps(expr) = cond.kind
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/author/issue_3849.stdout
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if let StmtKind::Local(local) = stmt.kind
if let StmtKind::Let(local) = stmt.kind
&& let Some(init) = local.init
&& let ExprKind::Call(func, args) = init.kind
&& let ExprKind::Path(ref qpath) = func.kind
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/author/loop.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if let Some(higher::ForLoop { pat: pat, arg: arg, body: body, .. }) = higher::Fo
&& let LitKind::Int(10, LitIntType::Unsuffixed) = lit1.node
&& let ExprKind::Block(block, None) = body.kind
&& block.stmts.len() == 1
&& let StmtKind::Local(local) = block.stmts[0].kind
&& let StmtKind::Let(local) = block.stmts[0].kind
&& let Some(init) = local.init
&& let ExprKind::Path(ref qpath1) = init.kind
&& match_qpath(qpath1, &["y"])
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/author/macro_in_closure.stdout
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if let StmtKind::Local(local) = stmt.kind
if let StmtKind::Let(local) = stmt.kind
&& let Some(init) = local.init
&& let ExprKind::Closure { capture_clause: CaptureBy::Ref, fn_decl: fn_decl, body: body_id, closure_kind: ClosureKind::Closure, .. } = init.kind
&& let FnRetTy::DefaultReturn(_) = fn_decl.output
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/author/matches.stdout
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if let StmtKind::Local(local) = stmt.kind
if let StmtKind::Let(local) = stmt.kind
&& let Some(init) = local.init
&& let ExprKind::Match(scrutinee, arms, MatchSource::Normal) = init.kind
&& let ExprKind::Lit(ref lit) = scrutinee.kind
Expand All @@ -16,7 +16,7 @@ if let StmtKind::Local(local) = stmt.kind
&& arms[1].guard.is_none()
&& let ExprKind::Block(block, None) = arms[1].body.kind
&& block.stmts.len() == 1
&& let StmtKind::Local(local1) = block.stmts[0].kind
&& let StmtKind::Let(local1) = block.stmts[0].kind
&& let Some(init1) = local1.init
&& let ExprKind::Lit(ref lit4) = init1.kind
&& let LitKind::Int(3, LitIntType::Unsuffixed) = lit4.node
Expand Down