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 {
304
304
} ;
305
305
306
306
// 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
+ }
309
311
310
312
score
311
313
} )
Original file line number Diff line number Diff line change @@ -2075,8 +2075,8 @@ fn test() {
2075
2075
fn fn_ctr_with_args(…) [type_could_unify]
2076
2076
fn fn_builder() [type_could_unify]
2077
2077
fn fn_ctr() [type_could_unify]
2078
- fn fn_other() [type_could_unify]
2079
2078
me fn_no_ret(…) [type_could_unify]
2079
+ fn fn_other() [type_could_unify]
2080
2080
"# ] ] ,
2081
2081
) ;
2082
2082
@@ -2150,8 +2150,8 @@ fn test() {
2150
2150
fn fn_builder() [type_could_unify]
2151
2151
fn fn_ctr() [type_could_unify]
2152
2152
fn fn_ctr2() [type_could_unify]
2153
- fn fn_other() [type_could_unify]
2154
2153
me fn_no_ret(…) [type_could_unify]
2154
+ fn fn_other() [type_could_unify]
2155
2155
"# ] ] ,
2156
2156
) ;
2157
2157
@@ -2183,8 +2183,8 @@ fn test() {
2183
2183
fn fn_builder() []
2184
2184
fn fn_ctr() []
2185
2185
fn fn_ctr2() []
2186
- fn fn_other() []
2187
2186
me fn_no_ret(…) []
2187
+ fn fn_other() []
2188
2188
"# ] ] ,
2189
2189
) ;
2190
2190
}
You can’t perform that action at this time.
0 commit comments