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 {
310
310
} ;
311
311
312
312
// 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
+ }
315
317
316
318
score
317
319
} )
Original file line number Diff line number Diff line change @@ -2078,8 +2078,8 @@ fn test() {
2078
2078
fn fn_ctr_with_args(…) [type_could_unify]
2079
2079
fn fn_builder() [type_could_unify]
2080
2080
fn fn_ctr() [type_could_unify]
2081
- fn fn_other() [type_could_unify]
2082
2081
me fn_no_ret(…) [type_could_unify]
2082
+ fn fn_other() [type_could_unify]
2083
2083
"# ] ] ,
2084
2084
) ;
2085
2085
@@ -2153,8 +2153,8 @@ fn test() {
2153
2153
fn fn_builder() [type_could_unify]
2154
2154
fn fn_ctr() [type_could_unify]
2155
2155
fn fn_ctr2() [type_could_unify]
2156
- fn fn_other() [type_could_unify]
2157
2156
me fn_no_ret(…) [type_could_unify]
2157
+ fn fn_other() [type_could_unify]
2158
2158
"# ] ] ,
2159
2159
) ;
2160
2160
@@ -2186,8 +2186,8 @@ fn test() {
2186
2186
fn fn_builder() []
2187
2187
fn fn_ctr() []
2188
2188
fn fn_ctr2() []
2189
- fn fn_other() []
2190
2189
me fn_no_ret(…) []
2190
+ fn fn_other() []
2191
2191
"# ] ] ,
2192
2192
) ;
2193
2193
}
You can’t perform that action at this time.
0 commit comments