Skip to content

Commit da61cf5

Browse files
committed
---
yaml --- r: 187954 b: refs/heads/tmp c: fe2e097 h: refs/heads/master v: v3
1 parent 9237bb2 commit da61cf5

File tree

2 files changed

+10
-19
lines changed

2 files changed

+10
-19
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3434
refs/heads/beta: 522d09dfecbeca1595f25ac58c6d0178bbd21d7d
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
37-
refs/heads/tmp: 8a7b6b3ee6a85aa60a1733727a4028a690744fdf
37+
refs/heads/tmp: fe2e0976decadb94cecc4ab85abdd02345cc7a64
3838
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/tmp/src/librustc_lint/builtin.rs

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,26 +1218,17 @@ impl LintPass for UnusedImportBraces {
12181218
}
12191219

12201220
fn check_item(&mut self, cx: &Context, item: &ast::Item) {
1221-
match item.node {
1222-
ast::ItemUse(ref view_path) => {
1223-
match view_path.node {
1224-
ast::ViewPathList(_, ref items) => {
1225-
if items.len() == 1 {
1226-
match items[0].node {
1227-
ast::PathListIdent {ref name, ..} => {
1228-
let m = format!("braces around {} is unnecessary",
1229-
&token::get_ident(*name));
1230-
cx.span_lint(UNUSED_IMPORT_BRACES, item.span,
1231-
&m[..]);
1232-
},
1233-
_ => ()
1234-
}
1235-
}
1221+
if let ast::ItemUse(ref view_path) = item.node {
1222+
if let ast::ViewPathList(_, ref items) = view_path.node {
1223+
if items.len() == 1 {
1224+
if let ast::PathListIdent {ref name, ..} = items[0].node {
1225+
let m = format!("braces around {} is unnecessary",
1226+
&token::get_ident(*name));
1227+
cx.span_lint(UNUSED_IMPORT_BRACES, item.span,
1228+
&m[..]);
12361229
}
1237-
_ => ()
12381230
}
1239-
},
1240-
_ => ()
1231+
}
12411232
}
12421233
}
12431234
}

0 commit comments

Comments
 (0)