mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-22 20:35:31 +00:00
Remove all upcasts!
It turns out there were a lot redundant too.
This commit is contained in:
parent
a775d21112
commit
8a9a1e3345
80 changed files with 1009 additions and 1257 deletions
|
|
@ -234,6 +234,8 @@ fn _format(
|
|||
file_id: FileId,
|
||||
expansion: &str,
|
||||
) -> Option<String> {
|
||||
use ide_db::base_db::RootQueryDb;
|
||||
|
||||
// hack until we get hygiene working (same character amount to preserve formatting as much as possible)
|
||||
const DOLLAR_CRATE_REPLACE: &str = "__r_a_";
|
||||
const BUILTIN_REPLACE: &str = "builtin__POUND";
|
||||
|
|
@ -247,9 +249,8 @@ fn _format(
|
|||
};
|
||||
let expansion = format!("{prefix}{expansion}{suffix}");
|
||||
|
||||
let upcast_db = ide_db::base_db::Upcast::<dyn ide_db::base_db::RootQueryDb>::upcast(db);
|
||||
let &crate_id = upcast_db.relevant_crates(file_id).iter().next()?;
|
||||
let edition = crate_id.data(upcast_db).edition;
|
||||
let &crate_id = db.relevant_crates(file_id).iter().next()?;
|
||||
let edition = crate_id.data(db).edition;
|
||||
|
||||
#[allow(clippy::disallowed_methods)]
|
||||
let mut cmd = std::process::Command::new(toolchain::Tool::Rustfmt.path());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue