mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Replace ra_hir_expand::either
with crate
This commit is contained in:
parent
15f143f0c3
commit
009437f5d9
23 changed files with 69 additions and 112 deletions
|
@ -4,6 +4,7 @@ pub(crate) mod src;
|
|||
|
||||
use std::sync::Arc;
|
||||
|
||||
use either::Either;
|
||||
use hir_def::{
|
||||
adt::VariantData,
|
||||
body::{Body, BodySourceMap},
|
||||
|
@ -30,7 +31,7 @@ use crate::{
|
|||
db::{DefDatabase, HirDatabase},
|
||||
ty::display::HirFormatter,
|
||||
ty::{self, InEnvironment, InferenceResult, TraitEnvironment, Ty, TyDefId, TypeCtor, TypeWalk},
|
||||
CallableDef, Either, HirDisplay, InFile, Name,
|
||||
CallableDef, HirDisplay, InFile, Name,
|
||||
};
|
||||
|
||||
/// hir::Crate describes a single crate. It's the main interface with which
|
||||
|
@ -905,7 +906,9 @@ impl Local {
|
|||
let (_body, source_map) = db.body_with_source_map(self.parent.into());
|
||||
let src = source_map.pat_syntax(self.pat_id).unwrap(); // Hmm...
|
||||
let root = src.file_syntax(db);
|
||||
src.map(|ast| ast.map(|it| it.cast().unwrap().to_node(&root), |it| it.to_node(&root)))
|
||||
src.map(|ast| {
|
||||
ast.map_left(|it| it.cast().unwrap().to_node(&root)).map_right(|it| it.to_node(&root))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue