diff options
Diffstat (limited to 'crates/ra_hir')
-rw-r--r-- | crates/ra_hir/src/ids.rs | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/crates/ra_hir/src/ids.rs b/crates/ra_hir/src/ids.rs index 8cdc7ee56..7ed5dbec7 100644 --- a/crates/ra_hir/src/ids.rs +++ b/crates/ra_hir/src/ids.rs | |||
@@ -5,7 +5,7 @@ use ra_syntax::{TreeArc, SyntaxNode, SourceFile, AstNode, ast}; | |||
5 | use ra_arena::{Arena, RawId, impl_arena_id}; | 5 | use ra_arena::{Arena, RawId, impl_arena_id}; |
6 | 6 | ||
7 | use crate::{ | 7 | use crate::{ |
8 | HirDatabase, Def, Crate, | 8 | HirDatabase, Def, |
9 | Module, Trait, Type, Static, Const, | 9 | Module, Trait, Type, Static, Const, |
10 | }; | 10 | }; |
11 | 11 | ||
@@ -284,16 +284,6 @@ impl DefId { | |||
284 | let syntax = db.file_item(loc.source_item_id); | 284 | let syntax = db.file_item(loc.source_item_id); |
285 | (loc.source_item_id.file_id, syntax) | 285 | (loc.source_item_id.file_id, syntax) |
286 | } | 286 | } |
287 | |||
288 | /// For a module, returns that module; for any other def, returns the containing module. | ||
289 | pub fn module(self, db: &impl HirDatabase) -> Module { | ||
290 | self.loc(db).module | ||
291 | } | ||
292 | |||
293 | /// Returns the containing crate. | ||
294 | pub fn krate(&self, db: &impl HirDatabase) -> Option<Crate> { | ||
295 | self.module(db).krate(db) | ||
296 | } | ||
297 | } | 287 | } |
298 | 288 | ||
299 | impl DefLoc { | 289 | impl DefLoc { |