@@ -209,10 +209,9 @@ fn find_path_inner(
209
209
) {
210
210
path. push_segment ( name) ;
211
211
212
- let new_path = if let Some ( best_path) = best_path {
213
- select_best_path ( best_path, path, prefer_no_std)
214
- } else {
215
- path
212
+ let new_path = match best_path {
213
+ Some ( best_path) => select_best_path ( best_path, path, prefer_no_std) ,
214
+ None => path,
216
215
} ;
217
216
best_path_len = new_path. len ( ) ;
218
217
best_path = Some ( new_path) ;
@@ -243,10 +242,9 @@ fn find_path_inner(
243
242
} ) ;
244
243
245
244
for path in extern_paths {
246
- let new_path = if let Some ( best_path) = best_path {
247
- select_best_path ( best_path, path, prefer_no_std)
248
- } else {
249
- path
245
+ let new_path = match best_path {
246
+ Some ( best_path) => select_best_path ( best_path, path, prefer_no_std) ,
247
+ None => path,
250
248
} ;
251
249
best_path = Some ( new_path) ;
252
250
}
@@ -261,12 +259,11 @@ fn find_path_inner(
261
259
}
262
260
}
263
261
264
- if let Some ( prefix ) = prefixed. map ( PrefixKind :: prefix) {
265
- best_path. or_else ( || {
262
+ match prefixed. map ( PrefixKind :: prefix) {
263
+ Some ( prefix ) => best_path. or_else ( || {
266
264
scope_name. map ( |scope_name| ModPath :: from_segments ( prefix, vec ! [ scope_name] ) )
267
- } )
268
- } else {
269
- best_path
265
+ } ) ,
266
+ None => best_path,
270
267
}
271
268
}
272
269
@@ -346,15 +343,13 @@ fn find_local_import_locations(
346
343
347
344
if let Some ( ( name, vis) ) = data. scope . name_of ( item) {
348
345
if vis. is_visible_from ( db, from) {
349
- let is_private = if let Visibility :: Module ( private_to) = vis {
350
- private_to. local_id == module. local_id
351
- } else {
352
- false
346
+ let is_private = match vis {
347
+ Visibility :: Module ( private_to) => private_to. local_id == module. local_id ,
348
+ Visibility :: Public => false ,
353
349
} ;
354
- let is_original_def = if let Some ( module_def_id) = item. as_module_def_id ( ) {
355
- data. scope . declarations ( ) . any ( |it| it == module_def_id)
356
- } else {
357
- false
350
+ let is_original_def = match item. as_module_def_id ( ) {
351
+ Some ( module_def_id) => data. scope . declarations ( ) . any ( |it| it == module_def_id) ,
352
+ None => false ,
358
353
} ;
359
354
360
355
// Ignore private imports. these could be used if we are
0 commit comments