Remove all upcasts!

It turns out there were a lot redundant too.
This commit is contained in:
Chayim Refael Friedman 2025-04-10 11:08:38 +03:00
parent a775d21112
commit 8a9a1e3345
80 changed files with 1009 additions and 1257 deletions

View file

@ -11,7 +11,7 @@ use hir::{
};
use ide_db::{
RootDatabase, SymbolKind,
base_db::{AnchoredPath, RootQueryDb, SourceDatabase, Upcast},
base_db::{AnchoredPath, SourceDatabase},
defs::{Definition, IdentClass},
famous_defs::FamousDefs,
helpers::pick_best_token,
@ -222,8 +222,7 @@ fn try_lookup_include_path(
}
let path = token.value.value().ok()?;
let file_id = Upcast::<dyn RootQueryDb>::upcast(sema.db)
.resolve_path(AnchoredPath { anchor: file_id, path: &path })?;
let file_id = sema.db.resolve_path(AnchoredPath { anchor: file_id, path: &path })?;
let size = sema.db.file_text(file_id).text(sema.db).len().try_into().ok()?;
Some(NavigationTarget {
file_id,