This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/tools/rust-analyzer/crates/ide-completion/src Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -252,14 +252,14 @@ impl CompletionRelevance {
252252 /// Provides a relevance score. Higher values are more relevant.
253253 ///
254254 /// The absolute value of the relevance score is not meaningful, for
255- /// example a value of 0 doesn't mean "not relevant", rather
255+ /// example a value of (!(0 as u32) / 2) doesn't mean "not relevant", rather
256256 /// it means "least relevant". The score value should only be used
257257 /// for relative ordering.
258258 ///
259259 /// See is_relevant if you need to make some judgement about score
260260 /// in an absolute sense.
261261 pub fn score ( self ) -> u32 {
262- let mut score = !0 / 2 ;
262+ let mut score = !( 0 as u32 ) / 2 ;
263263 let CompletionRelevance {
264264 exact_name_match,
265265 type_match,
@@ -350,7 +350,7 @@ impl CompletionRelevance {
350350 /// some threshold such that we think it is especially likely
351351 /// to be relevant.
352352 pub fn is_relevant ( & self ) -> bool {
353- self . score ( ) > ( ! 0 / 2 )
353+ self . score ( ) > ! ( 0 as u32 ) / 2
354354 }
355355}
356356
You can’t perform that action at this time.
0 commit comments