diff options
author | Aleksey Kladov <[email protected]> | 2019-01-24 20:46:48 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-24 20:46:48 +0000 |
commit | 1a5f32fcb516c1647c7581f21be9b11c8f1f94ba (patch) | |
tree | 79edc4d2ff1d9d5c6e39d2d4628aaf1e20945563 /crates/ra_hir/src | |
parent | f3a37522a027a10c257f4dfdc2369e7853e0c80e (diff) |
remove dead code
Diffstat (limited to 'crates/ra_hir/src')
-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 { |