@@ -828,7 +828,7 @@ mod tests {
828828 items. push ( format ! (
829829 "{tag} {} {} {relevance}\n " ,
830830 it. label. primary,
831- it. label. detail_right. clone ( ) . unwrap_or_default( ) ,
831+ it. label. detail_right. as_deref ( ) . unwrap_or_default( ) ,
832832 ) ) ;
833833
834834 if let Some ( ( label, _indel, relevance) ) = it. ref_match ( ) {
@@ -844,24 +844,31 @@ mod tests {
844844 expect. assert_eq ( & actual) ;
845845
846846 fn display_relevance ( relevance : CompletionRelevance ) -> String {
847- let relevance_factors = vec ! [
848- ( relevance. type_match == Some ( CompletionRelevanceTypeMatch :: Exact ) , "type" ) ,
849- (
850- relevance. type_match == Some ( CompletionRelevanceTypeMatch :: CouldUnify ) ,
851- "type_could_unify" ,
852- ) ,
853- ( relevance. exact_name_match, "name" ) ,
854- ( relevance. is_local, "local" ) ,
855- (
856- relevance. postfix_match == Some ( CompletionRelevancePostfixMatch :: Exact ) ,
857- "snippet" ,
858- ) ,
859- ( relevance. trait_. is_some_and( |it| it. is_op_method) , "op_method" ) ,
860- ( relevance. requires_import, "requires_import" ) ,
861- ( relevance. has_local_inherent_impl, "has_local_inherent_impl" ) ,
847+ let CompletionRelevance {
848+ exact_name_match,
849+ type_match,
850+ is_local,
851+ trait_,
852+ is_name_already_imported : _,
853+ requires_import,
854+ is_private_editable : _,
855+ postfix_match,
856+ function : _,
857+ is_skipping_completion : _,
858+ has_local_inherent_impl,
859+ } = relevance;
860+ let relevance_factors = [
861+ ( type_match == Some ( CompletionRelevanceTypeMatch :: Exact ) , "type" ) ,
862+ ( type_match == Some ( CompletionRelevanceTypeMatch :: CouldUnify ) , "type_could_unify" ) ,
863+ ( exact_name_match, "name" ) ,
864+ ( is_local, "local" ) ,
865+ ( postfix_match == Some ( CompletionRelevancePostfixMatch :: Exact ) , "snippet" ) ,
866+ ( trait_. is_some_and ( |it| it. is_op_method ) , "op_method" ) ,
867+ ( requires_import, "requires_import" ) ,
868+ ( has_local_inherent_impl, "has_local_inherent_impl" ) ,
862869 ]
863870 . into_iter ( )
864- . filter_map ( |( cond, desc) | if cond { Some ( desc) } else { None } )
871+ . filter_map ( |( cond, desc) | cond. then_some ( desc) )
865872 . join ( "+" ) ;
866873
867874 format ! ( "[{relevance_factors}]" )
0 commit comments