aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_hir/src/ids.rs12
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};
5use ra_arena::{Arena, RawId, impl_arena_id}; 5use ra_arena::{Arena, RawId, impl_arena_id};
6 6
7use crate::{ 7use 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
299impl DefLoc { 289impl DefLoc {