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
13 lines
464 B
Plaintext
13 lines
464 B
Plaintext
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
|
|
&& match_qpath(qpath, &["char"])
|
|
&& let ExprKind::Lit(ref lit) = expr.kind
|
|
&& let LitKind::Int(69, LitIntType::Unsuffixed) = lit.node
|
|
&& let PatKind::Binding(BindingMode::NONE, _, name, None) = local.pat.kind
|
|
&& name.as_str() == "x"
|
|
{
|
|
// report your lint here
|
|
}
|