From 009437f5d9949d2276aa26040e03af0ab328acf3 Mon Sep 17 00:00:00 2001 From: ice1000 Date: Tue, 3 Dec 2019 11:07:56 -0500 Subject: Replace `ra_hir_expand::either` with crate --- crates/ra_ide/src/completion/complete_path.rs | 5 +++-- crates/ra_ide/src/display/navigation_target.rs | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'crates/ra_ide/src') diff --git a/crates/ra_ide/src/completion/complete_path.rs b/crates/ra_ide/src/completion/complete_path.rs index 89e0009a1..28f94e0a7 100644 --- a/crates/ra_ide/src/completion/complete_path.rs +++ b/crates/ra_ide/src/completion/complete_path.rs @@ -1,6 +1,7 @@ //! FIXME: write short doc here -use hir::{Adt, Either, HasSource, PathResolution}; +use either::Either; +use hir::{Adt, HasSource, PathResolution}; use ra_syntax::AstNode; use test_utils::tested_by; @@ -27,7 +28,7 @@ pub(super) fn complete_path(acc: &mut Completions, ctx: &CompletionContext) { } if Some(module) == ctx.module { if let Some(import) = import { - if let Either::A(use_tree) = import.source(ctx.db).value { + if let Either::Left(use_tree) = import.source(ctx.db).value { if use_tree.syntax().text_range().contains_inclusive(ctx.offset) { // for `use self::foo<|>`, don't suggest `foo` as a completion tested_by!(dont_complete_current_use); diff --git a/crates/ra_ide/src/display/navigation_target.rs b/crates/ra_ide/src/display/navigation_target.rs index 61dca14ac..f920d3db6 100644 --- a/crates/ra_ide/src/display/navigation_target.rs +++ b/crates/ra_ide/src/display/navigation_target.rs @@ -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(), -- cgit v1.2.3