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 @@ -304,8 +304,10 @@ impl CompletionRelevance {
304304 } ;
305305
306306 // Prefer functions with no arguments, then functions with self arguments
307- score += if !asf. has_args { 2 } else { 0 } ;
308- score -= if score > 0 && asf. has_self_arg { 1 } else { 0 } ;
307+ if score > 0 {
308+ score += if !asf. has_args { 2 } else { 0 } ;
309+ score -= if asf. has_self_arg { 1 } else { 0 } ;
310+ }
309311
310312 score
311313 } )
Original file line number Diff line number Diff line change @@ -2075,8 +2075,8 @@ fn test() {
20752075 fn fn_ctr_with_args(…) [type_could_unify]
20762076 fn fn_builder() [type_could_unify]
20772077 fn fn_ctr() [type_could_unify]
2078- fn fn_other() [type_could_unify]
20792078 me fn_no_ret(…) [type_could_unify]
2079+ fn fn_other() [type_could_unify]
20802080 "# ] ] ,
20812081 ) ;
20822082
@@ -2150,8 +2150,8 @@ fn test() {
21502150 fn fn_builder() [type_could_unify]
21512151 fn fn_ctr() [type_could_unify]
21522152 fn fn_ctr2() [type_could_unify]
2153- fn fn_other() [type_could_unify]
21542153 me fn_no_ret(…) [type_could_unify]
2154+ fn fn_other() [type_could_unify]
21552155 "# ] ] ,
21562156 ) ;
21572157
@@ -2183,8 +2183,8 @@ fn test() {
21832183 fn fn_builder() []
21842184 fn fn_ctr() []
21852185 fn fn_ctr2() []
2186- fn fn_other() []
21872186 me fn_no_ret(…) []
2187+ fn fn_other() []
21882188 "# ] ] ,
21892189 ) ;
21902190 }
You can’t perform that action at this time.
0 commit comments