diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-08-19 18:00:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-19 18:00:01 +0100 |
commit | f5b7540f388e815b3c4c2fb28b8233c724e0a838 (patch) | |
tree | 15017f0b41ea44614d603f0b9e029e7bc86a5c44 /crates/ssr/src | |
parent | 686a6a26fd2263e4bb958fbcf94b04244ed73e08 (diff) | |
parent | 81b0976187d73eba4f9b14d8a0b8539ab8f06dcd (diff) |
Merge #5820
5820: Future proof find-usages API
r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Diffstat (limited to 'crates/ssr/src')
-rw-r--r-- | crates/ssr/src/search.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ssr/src/search.rs b/crates/ssr/src/search.rs index 8509cfa4d..a595fd269 100644 --- a/crates/ssr/src/search.rs +++ b/crates/ssr/src/search.rs | |||
@@ -114,7 +114,7 @@ impl<'db> MatchFinder<'db> { | |||
114 | // cache miss. This is a limitation of NLL and is fixed with Polonius. For now we do two | 114 | // cache miss. This is a limitation of NLL and is fixed with Polonius. For now we do two |
115 | // lookups in the case of a cache hit. | 115 | // lookups in the case of a cache hit. |
116 | if usage_cache.find(&definition).is_none() { | 116 | if usage_cache.find(&definition).is_none() { |
117 | let usages = definition.find_usages(&self.sema, Some(self.search_scope())); | 117 | let usages = definition.usages(&self.sema).in_scope(self.search_scope()).all(); |
118 | usage_cache.usages.push((definition, usages)); | 118 | usage_cache.usages.push((definition, usages)); |
119 | return &usage_cache.usages.last().unwrap().1; | 119 | return &usage_cache.usages.last().unwrap().1; |
120 | } | 120 | } |