forked from rust-lang/rust
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#9595 - Alexendoo:author-let-chains, r=Jarcho
Replace if_chain with let chains in `clippy::author` output Should help nudge new contributors towards let chains changelog: none
- Loading branch information
Showing
10 changed files
with
387 additions
and
420 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
if_chain! { | ||
if let StmtKind::Local(local) = stmt.kind; | ||
if let Some(init) = local.init; | ||
if let ExprKind::Cast(expr, cast_ty) = init.kind; | ||
if let TyKind::Path(ref qpath) = cast_ty.kind; | ||
if match_qpath(qpath, &["char"]); | ||
if let ExprKind::Lit(ref lit) = expr.kind; | ||
if let LitKind::Int(69, LitIntType::Unsuffixed) = lit.node; | ||
if let PatKind::Binding(BindingAnnotation::NONE, _, name, None) = local.pat.kind; | ||
if name.as_str() == "x"; | ||
then { | ||
// report your lint here | ||
} | ||
if let StmtKind::Local(local) = stmt.kind | ||
&& let Some(init) = local.init | ||
&& let ExprKind::Cast(expr, cast_ty) = init.kind | ||
&& let TyKind::Path(ref qpath) = cast_ty.kind | ||
&& match_qpath(qpath, &["char"]) | ||
&& let ExprKind::Lit(ref lit) = expr.kind | ||
&& let LitKind::Int(69, LitIntType::Unsuffixed) = lit.node | ||
&& let PatKind::Binding(BindingAnnotation::NONE, _, name, None) = local.pat.kind | ||
&& name.as_str() == "x" | ||
{ | ||
// report your lint here | ||
} |
Oops, something went wrong.