-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
43 additions
and
81 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
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 was deleted.
Oops, something went wrong.
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,4 +1,4 @@ | ||
#![feature(tool_attributes)] | ||
#![allow(clippy::let_and_return)] | ||
|
||
fn main() { | ||
#[clippy::author] | ||
|
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
if_chain! { | ||
if let StmtKind::Local(ref local) = stmt.kind; | ||
if let Some(ref init) = local.init; | ||
if let ExprKind::Match(ref expr, ref arms, MatchSource::Normal) = init.kind; | ||
if let ExprKind::Lit(ref lit) = expr.kind; | ||
if let LitKind::Int(42, _) = lit.node; | ||
if arms.len() == 3; | ||
if let ExprKind::Lit(ref lit1) = arms[0].body.kind; | ||
if let LitKind::Int(5, _) = lit1.node; | ||
if let PatKind::Lit(ref lit_expr) = arms[0].pat.kind | ||
if let ExprKind::Lit(ref lit2) = lit_expr.kind; | ||
if let LitKind::Int(16, _) = lit2.node; | ||
if let ExprKind::Block(ref block) = arms[1].body.kind; | ||
if let Some(trailing_expr) = &block.expr; | ||
if block.stmts.len() == 1; | ||
if let StmtKind::Local(ref local1) = block.stmts[0].kind; | ||
if let Some(ref init1) = local1.init; | ||
if let ExprKind::Lit(ref lit3) = init1.kind; | ||
if let LitKind::Int(3, _) = lit3.node; | ||
if let PatKind::Binding(BindingAnnotation::Unannotated, _, name, None) = local1.pat.kind; | ||
if name.as_str() == "x"; | ||
if let PatKind::Lit(ref lit_expr1) = arms[1].pat.kind | ||
if let ExprKind::Lit(ref lit4) = lit_expr1.kind; | ||
if let LitKind::Int(17, _) = lit4.node; | ||
if let ExprKind::Lit(ref lit5) = arms[2].body.kind; | ||
if let LitKind::Int(1, _) = lit5.node; | ||
if let PatKind::Wild = arms[2].pat.kind; | ||
if let PatKind::Binding(BindingAnnotation::Unannotated, _, name1, None) = local.pat.kind; | ||
if name1.as_str() == "a"; | ||
then { | ||
// report your lint here | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.