File tree 1 file changed +9
-18
lines changed 1 file changed +9
-18
lines changed Original file line number Diff line number Diff line change @@ -1218,26 +1218,17 @@ impl LintPass for UnusedImportBraces {
1218
1218
}
1219
1219
1220
1220
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[ ..] ) ;
1236
1229
}
1237
- _ => ( )
1238
1230
}
1239
- } ,
1240
- _ => ( )
1231
+ }
1241
1232
}
1242
1233
}
1243
1234
}
You can’t perform that action at this time.
0 commit comments