From 45d05ed78384b28fbd341068f36912a2e0308292 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 26 Nov 2019 15:27:33 +0300 Subject: id-ify impls_in_crate_query --- crates/ra_ide_api/src/impls.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/ra_ide_api') diff --git a/crates/ra_ide_api/src/impls.rs b/crates/ra_ide_api/src/impls.rs index 2b3100fc3..b3ebd9145 100644 --- a/crates/ra_ide_api/src/impls.rs +++ b/crates/ra_ide_api/src/impls.rs @@ -1,6 +1,6 @@ //! FIXME: write short doc here -use hir::{db::HirDatabase, ApplicationTy, FromSource, Ty, TypeCtor}; +use hir::{ApplicationTy, FromSource, ImplBlock, Ty, TypeCtor}; use ra_db::SourceDatabase; use ra_syntax::{algo::find_node_at_offset, ast, AstNode}; @@ -56,11 +56,11 @@ fn impls_for_def( }; let krate = module.krate(); - let impls = db.impls_in_crate(krate); + let impls = ImplBlock::all_in_crate(db, krate); Some( impls - .all_impls() + .into_iter() .filter(|impl_block| is_equal_for_find_impls(&ty, &impl_block.target_ty(db))) .map(|imp| imp.to_nav(db)) .collect(), @@ -77,9 +77,9 @@ fn impls_for_trait( let tr = hir::Trait::from_source(db, src)?; let krate = module.krate(); - let impls = db.impls_in_crate(krate); + let impls = ImplBlock::for_trait(db, krate, tr); - Some(impls.lookup_impl_blocks_for_trait(tr).map(|imp| imp.to_nav(db)).collect()) + Some(impls.into_iter().map(|imp| imp.to_nav(db)).collect()) } fn is_equal_for_find_impls(original_ty: &Ty, impl_ty: &Ty) -> bool { -- cgit v1.2.3