aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_db/src/helpers.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide_db/src/helpers.rs')
-rw-r--r--crates/ide_db/src/helpers.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/crates/ide_db/src/helpers.rs b/crates/ide_db/src/helpers.rs
index 66798ea3a..21b48237a 100644
--- a/crates/ide_db/src/helpers.rs
+++ b/crates/ide_db/src/helpers.rs
@@ -1,6 +1,8 @@
1//! A module with ide helpers for high-level ide features. 1//! A module with ide helpers for high-level ide features.
2pub mod insert_use;
3pub mod import_assets; 2pub mod import_assets;
3pub mod insert_use;
4pub mod merge_imports;
5pub mod rust_doc;
4 6
5use std::collections::VecDeque; 7use std::collections::VecDeque;
6 8
@@ -113,6 +115,10 @@ impl FamousDefs<'_, '_> {
113 self.find_module("core:iter") 115 self.find_module("core:iter")
114 } 116 }
115 117
118 pub fn core_ops_Deref(&self) -> Option<Trait> {
119 self.find_trait("core:ops:Deref")
120 }
121
116 fn find_trait(&self, path: &str) -> Option<Trait> { 122 fn find_trait(&self, path: &str) -> Option<Trait> {
117 match self.find_def(path)? { 123 match self.find_def(path)? {
118 hir::ScopeDef::ModuleDef(hir::ModuleDef::Trait(it)) => Some(it), 124 hir::ScopeDef::ModuleDef(hir::ModuleDef::Trait(it)) => Some(it),