698363122e
Before this change, adding a lint was a difficult matter because it always had some overhead involved. This was because all lints would run, no matter their default level, or if the user had #![allow]ed them. This PR changes that
15 lines
558 B
Plaintext
15 lines
558 B
Plaintext
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
|
|
&& match_qpath(qpath, &["{{root}}", "std", "cmp", "min"])
|
|
&& args.len() == 2
|
|
&& let ExprKind::Lit(ref lit) = args[0].kind
|
|
&& let LitKind::Int(3, LitIntType::Unsuffixed) = lit.node
|
|
&& let ExprKind::Lit(ref lit1) = args[1].kind
|
|
&& let LitKind::Int(4, LitIntType::Unsuffixed) = lit1.node
|
|
&& let PatKind::Wild = local.pat.kind
|
|
{
|
|
// report your lint here
|
|
}
|