aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/code_model.rs
diff options
context:
space:
mode:
authorice1000 <[email protected]>2019-12-03 16:07:56 +0000
committerice1000 <[email protected]>2019-12-03 16:07:56 +0000
commit009437f5d9949d2276aa26040e03af0ab328acf3 (patch)
tree74a889d70e201d6997c6baf179261ab3ed8bf23c /crates/ra_hir/src/code_model.rs
parent15f143f0c33cbd382a2ad7a407d9601cb843d164 (diff)
Replace `ra_hir_expand::either` with crate
Diffstat (limited to 'crates/ra_hir/src/code_model.rs')
-rw-r--r--crates/ra_hir/src/code_model.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs
index dddac915b..5877afefa 100644
--- a/crates/ra_hir/src/code_model.rs
+++ b/crates/ra_hir/src/code_model.rs
@@ -4,6 +4,7 @@ pub(crate) mod src;
4 4
5use std::sync::Arc; 5use std::sync::Arc;
6 6
7use either::Either;
7use hir_def::{ 8use hir_def::{
8 adt::VariantData, 9 adt::VariantData,
9 body::{Body, BodySourceMap}, 10 body::{Body, BodySourceMap},
@@ -30,7 +31,7 @@ use crate::{
30 db::{DefDatabase, HirDatabase}, 31 db::{DefDatabase, HirDatabase},
31 ty::display::HirFormatter, 32 ty::display::HirFormatter,
32 ty::{self, InEnvironment, InferenceResult, TraitEnvironment, Ty, TyDefId, TypeCtor, TypeWalk}, 33 ty::{self, InEnvironment, InferenceResult, TraitEnvironment, Ty, TyDefId, TypeCtor, TypeWalk},
33 CallableDef, Either, HirDisplay, InFile, Name, 34 CallableDef, HirDisplay, InFile, Name,
34}; 35};
35 36
36/// hir::Crate describes a single crate. It's the main interface with which 37/// hir::Crate describes a single crate. It's the main interface with which
@@ -905,7 +906,9 @@ impl Local {
905 let (_body, source_map) = db.body_with_source_map(self.parent.into()); 906 let (_body, source_map) = db.body_with_source_map(self.parent.into());
906 let src = source_map.pat_syntax(self.pat_id).unwrap(); // Hmm... 907 let src = source_map.pat_syntax(self.pat_id).unwrap(); // Hmm...
907 let root = src.file_syntax(db); 908 let root = src.file_syntax(db);
908 src.map(|ast| ast.map(|it| it.cast().unwrap().to_node(&root), |it| it.to_node(&root))) 909 src.map(|ast| {
910 ast.map_left(|it| it.cast().unwrap().to_node(&root)).map_right(|it| it.to_node(&root))
911 })
909 } 912 }
910} 913}
911 914