From 156b7ee84210583fa2fdc7fb8ae1dccafdf80830 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 11 Jun 2019 01:06:11 +0300 Subject: use single version of either in hir --- crates/ra_hir/src/nameres/tests.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'crates/ra_hir/src/nameres/tests.rs') diff --git a/crates/ra_hir/src/nameres/tests.rs b/crates/ra_hir/src/nameres/tests.rs index a15e62bbe..adac814d9 100644 --- a/crates/ra_hir/src/nameres/tests.rs +++ b/crates/ra_hir/src/nameres/tests.rs @@ -8,10 +8,9 @@ use std::sync::Arc; use ra_db::SourceDatabase; use test_utils::covers; use insta::assert_snapshot_matches; -use either::Either; use crate::{ - Crate, + Crate, Either, mock::{MockDatabase, CrateGraphFixture}, nameres::Resolution, }; @@ -37,19 +36,17 @@ fn render_crate_def_map(map: &CrateDefMap) -> String { *buf += path; *buf += "\n"; - let items = - map.modules[module].scope.items.iter().map(|(name, it)| (name, Either::Left(it))); - let macros = - map.modules[module].scope.macros.iter().map(|(name, m)| (name, Either::Right(m))); + let items = map.modules[module].scope.items.iter().map(|(name, it)| (name, Either::A(it))); + let macros = map.modules[module].scope.macros.iter().map(|(name, m)| (name, Either::B(m))); let mut entries = items.chain(macros).collect::>(); entries.sort_by_key(|(name, _)| *name); for (name, res) in entries { match res { - Either::Left(it) => { + Either::A(it) => { *buf += &format!("{}: {}\n", name, dump_resolution(it)); } - Either::Right(_) => { + Either::B(_) => { *buf += &format!("{}: m\n", name); } } -- cgit v1.2.3