]> git.lizzy.rs Git - rust.git/commitdiff
Remove the upcast
authorKirill Bulatov <mail4score@gmail.com>
Mon, 23 Mar 2020 07:59:14 +0000 (09:59 +0200)
committerKirill Bulatov <mail4score@gmail.com>
Tue, 24 Mar 2020 08:43:00 +0000 (10:43 +0200)
crates/ra_hir/src/code_model.rs

index 146e7820e61cbeeb268281566ac5a4351cd73840..9e4aa60227d0e779a2912954b8563cde123daae8 100644 (file)
 };
 use rustc_hash::FxHashSet;
 
-use crate::{db::HirDatabase, has_source::HasSource, CallableDef, HirDisplay, InFile, Name};
+use crate::{
+    db::{DefDatabase, HirDatabase},
+    has_source::HasSource,
+    CallableDef, HirDisplay, InFile, Name,
+};
 
 /// hir::Crate describes a single crate. It's the main interface with which
 /// a crate's dependencies interact. Mostly, it should be just a proxy for the
@@ -285,10 +289,10 @@ pub(crate) fn with_module_id(self, module_id: LocalModuleId) -> Module {
     /// this module, if possible.
     pub fn find_use_path(
         self,
-        db: &dyn HirDatabase,
+        db: &dyn DefDatabase,
         item: ItemInNs,
     ) -> Option<hir_def::path::ModPath> {
-        hir_def::find_path::find_path(db.upcast(), item, self.into())
+        hir_def::find_path::find_path(db, item, self.into())
     }
 }