File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
crates/ide-completion/src Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -310,8 +310,10 @@ impl CompletionRelevance {
310310 } ;
311311
312312 // Prefer functions with no arguments, then functions with self arguments
313- score += if !asf. has_args { 2 } else { 0 } ;
314- score -= if score > 0 && asf. has_self_arg { 1 } else { 0 } ;
313+ if score > 0 {
314+ score += if !asf. has_args { 2 } else { 0 } ;
315+ score -= if asf. has_self_arg { 1 } else { 0 } ;
316+ }
315317
316318 score
317319 } )
Original file line number Diff line number Diff line change @@ -2078,8 +2078,8 @@ fn test() {
20782078 fn fn_ctr_with_args(…) [type_could_unify]
20792079 fn fn_builder() [type_could_unify]
20802080 fn fn_ctr() [type_could_unify]
2081- fn fn_other() [type_could_unify]
20822081 me fn_no_ret(…) [type_could_unify]
2082+ fn fn_other() [type_could_unify]
20832083 "# ] ] ,
20842084 ) ;
20852085
@@ -2153,8 +2153,8 @@ fn test() {
21532153 fn fn_builder() [type_could_unify]
21542154 fn fn_ctr() [type_could_unify]
21552155 fn fn_ctr2() [type_could_unify]
2156- fn fn_other() [type_could_unify]
21572156 me fn_no_ret(…) [type_could_unify]
2157+ fn fn_other() [type_could_unify]
21582158 "# ] ] ,
21592159 ) ;
21602160
@@ -2186,8 +2186,8 @@ fn test() {
21862186 fn fn_builder() []
21872187 fn fn_ctr() []
21882188 fn fn_ctr2() []
2189- fn fn_other() []
21902189 me fn_no_ret(…) []
2190+ fn fn_other() []
21912191 "# ] ] ,
21922192 ) ;
21932193 }
You can’t perform that action at this time.
0 commit comments