diff options
| author | bors <bors@rust-lang.org> | 2015-10-28 09:39:43 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-10-28 09:39:43 +0000 |
| commit | 18ff06ecc1cf4dae9d96c84be9320dfe8f95f491 (patch) | |
| tree | 62adf357667d575988c16051816e7812996ee2ed /src | |
| parent | a455edfa7152ffcb31c6eba66c1ff230dba3eef1 (diff) | |
| parent | fb7e325900658c6731290a91348f9c791c79e130 (diff) | |
| download | rust-18ff06ecc1cf4dae9d96c84be9320dfe8f95f491.tar.gz rust-18ff06ecc1cf4dae9d96c84be9320dfe8f95f491.zip | |
Auto merge of #29402 - sanxiyn:if-let, r=steveklabnik
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_lint/types.rs | 7 | ||||
| -rw-r--r-- | src/librustc_lint/unused.rs | 12 |
2 files changed, 6 insertions, 13 deletions
diff --git a/src/librustc_lint/types.rs b/src/librustc_lint/types.rs index 264228a7052..abbb733d884 100644 --- a/src/librustc_lint/types.rs +++ b/src/librustc_lint/types.rs @@ -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 { } } } - _ => (), } } } diff --git a/src/librustc_lint/unused.rs b/src/librustc_lint/unused.rs index 7f80763fb6d..2384b3987f2 100644 --- a/src/librustc_lint/unused.rs +++ b/src/librustc_lint/unused.rs @@ -220,15 +220,11 @@ 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"); } - _ => () } } } |
