]> git.lizzy.rs Git - rust.git/commitdiff
Use new `Definition::usages` API in expand glob import
authorunexge <unexge@gmail.com>
Wed, 19 Aug 2020 17:16:03 +0000 (20:16 +0300)
committerunexge <unexge@gmail.com>
Thu, 20 Aug 2020 18:35:47 +0000 (21:35 +0300)
crates/assists/src/handlers/expand_glob_import.rs

index eb6dd68bbcc945361ebd51f703818ff5d57cf7a1..b39d040f6fdae62d939aa86a7ef6faa1c3a09647 100644 (file)
@@ -98,7 +98,7 @@ fn is_referenced_in(&self, ctx: &AssistContext) -> bool {
         };
 
         let search_scope = SearchScope::single_file(ctx.frange.file_id);
-        !def.find_usages(&ctx.sema, Some(search_scope)).is_empty()
+        def.usages(&ctx.sema).in_scope(search_scope).at_least_one()
     }
 }