Replace ra_hir_expand::either with crate

This commit is contained in:
ice1000
2019-12-03 11:07:56 -05:00
parent 15f143f0c3
commit 009437f5d9
23 changed files with 69 additions and 112 deletions

View File

@@ -1,6 +1,7 @@
//! FIXME: write short doc here
use hir::{AssocItem, Either, FieldSource, HasSource, InFile, ModuleSource};
use either::Either;
use hir::{AssocItem, FieldSource, HasSource, InFile, ModuleSource};
use ra_db::{FileId, SourceDatabase};
use ra_syntax::{
ast::{self, DocCommentsOwner, NameOwner},
@@ -342,10 +343,10 @@ impl ToNav for hir::Local {
fn to_nav(&self, db: &RootDatabase) -> NavigationTarget {
let src = self.source(db);
let (full_range, focus_range) = match src.value {
Either::A(it) => {
Either::Left(it) => {
(it.syntax().text_range(), it.name().map(|it| it.syntax().text_range()))
}
Either::B(it) => (it.syntax().text_range(), Some(it.self_kw_token().text_range())),
Either::Right(it) => (it.syntax().text_range(), Some(it.self_kw_token().text_range())),
};
let name = match self.name(db) {
Some(it) => it.to_string().into(),