diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-11-20 15:45:22 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-11-20 15:45:22 +0000 |
commit | c51dcb1c4bdd71f9f17de508bd0d47e3c06ae1d5 (patch) | |
tree | 7e96d773620a3b03254d00386711cdc7c909e3ee /crates/ra_hir/src/impl_block.rs | |
parent | b7a36b54431ca5b746af53549a1b6e142570c7f4 (diff) | |
parent | 111891dc2dc1d2c7ea87144e8e3ddefe23fc7b6d (diff) |
Merge #2327
2327: Move constants to new ID r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src/impl_block.rs')
-rw-r--r-- | crates/ra_hir/src/impl_block.rs | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/crates/ra_hir/src/impl_block.rs b/crates/ra_hir/src/impl_block.rs index 0c2bb8fee..0513f28a9 100644 --- a/crates/ra_hir/src/impl_block.rs +++ b/crates/ra_hir/src/impl_block.rs | |||
@@ -19,14 +19,6 @@ impl HasSource for ImplBlock { | |||
19 | } | 19 | } |
20 | 20 | ||
21 | impl ImplBlock { | 21 | impl ImplBlock { |
22 | pub(crate) fn containing(db: &impl DefDatabase, item: AssocItem) -> Option<ImplBlock> { | ||
23 | let module = item.module(db); | ||
24 | let crate_def_map = db.crate_def_map(module.id.krate); | ||
25 | crate_def_map[module.id.module_id].impls.iter().copied().map(ImplBlock::from).find(|it| { | ||
26 | db.impl_data(it.id).items().iter().copied().map(AssocItem::from).any(|it| it == item) | ||
27 | }) | ||
28 | } | ||
29 | |||
30 | pub fn target_trait(&self, db: &impl DefDatabase) -> Option<TypeRef> { | 22 | pub fn target_trait(&self, db: &impl DefDatabase) -> Option<TypeRef> { |
31 | db.impl_data(self.id).target_trait().cloned() | 23 | db.impl_data(self.id).target_trait().cloned() |
32 | } | 24 | } |