Auto merge of #29402 - sanxiyn:if-let, r=steveklabnik

This commit is contained in:
bors 2015-10-28 09:39:43 +00:00
commit 18ff06ecc1
2 changed files with 6 additions and 13 deletions

View file

@ -659,10 +659,8 @@ impl LateLintPass for ImproperCTypes {
}
}
match it.node {
hir::ItemForeignMod(ref nmod)
if nmod.abi != abi::RustIntrinsic &&
nmod.abi != abi::PlatformIntrinsic => {
if let hir::ItemForeignMod(ref nmod) = it.node {
if nmod.abi != abi::RustIntrinsic && nmod.abi != abi::PlatformIntrinsic {
for ni in &nmod.items {
match ni.node {
hir::ForeignItemFn(ref decl, _) => check_foreign_fn(cx, &**decl),
@ -670,7 +668,6 @@ impl LateLintPass for ImproperCTypes {
}
}
}
_ => (),
}
}
}

View file

@ -220,16 +220,12 @@ impl LintPass for PathStatements {
impl LateLintPass for PathStatements {
fn check_stmt(&mut self, cx: &LateContext, s: &hir::Stmt) {
match s.node {
hir::StmtSemi(ref expr, _) => {
match expr.node {
hir::ExprPath(..) => cx.span_lint(PATH_STATEMENTS, s.span,
"path statement with no effect"),
_ => ()
if let hir::StmtSemi(ref expr, _) = s.node {
if let hir::ExprPath(..) = expr.node {
cx.span_lint(PATH_STATEMENTS, s.span,
"path statement with no effect");
}
}
_ => ()
}
}
}