@@ -209,10 +209,9 @@ fn find_path_inner(
209209 ) {
210210 path. push_segment ( name) ;
211211
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,
216215 } ;
217216 best_path_len = new_path. len ( ) ;
218217 best_path = Some ( new_path) ;
@@ -243,10 +242,9 @@ fn find_path_inner(
243242 } ) ;
244243
245244 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,
250248 } ;
251249 best_path = Some ( new_path) ;
252250 }
@@ -261,12 +259,11 @@ fn find_path_inner(
261259 }
262260 }
263261
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 ( || {
266264 scope_name. map ( |scope_name| ModPath :: from_segments ( prefix, vec ! [ scope_name] ) )
267- } )
268- } else {
269- best_path
265+ } ) ,
266+ None => best_path,
270267 }
271268}
272269
@@ -346,15 +343,13 @@ fn find_local_import_locations(
346343
347344 if let Some ( ( name, vis) ) = data. scope . name_of ( item) {
348345 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 ,
353349 } ;
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 ,
358353 } ;
359354
360355 // Ignore private imports. these could be used if we are
0 commit comments