aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_expand/src/hygiene.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_expand/src/hygiene.rs')
-rw-r--r--crates/ra_hir_expand/src/hygiene.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_hir_expand/src/hygiene.rs b/crates/ra_hir_expand/src/hygiene.rs
index 379562a2c..64c8b06c6 100644
--- a/crates/ra_hir_expand/src/hygiene.rs
+++ b/crates/ra_hir_expand/src/hygiene.rs
@@ -2,12 +2,12 @@
2//! 2//!
3//! Specifically, `ast` + `Hygiene` allows you to create a `Name`. Note that, at 3//! Specifically, `ast` + `Hygiene` allows you to create a `Name`. Note that, at
4//! this moment, this is horribly incomplete and handles only `$crate`. 4//! this moment, this is horribly incomplete and handles only `$crate`.
5use either::Either;
5use ra_db::CrateId; 6use ra_db::CrateId;
6use ra_syntax::ast; 7use ra_syntax::ast;
7 8
8use crate::{ 9use crate::{
9 db::AstDatabase, 10 db::AstDatabase,
10 either::Either,
11 name::{AsName, Name}, 11 name::{AsName, Name},
12 HirFileId, HirFileIdRepr, MacroDefKind, 12 HirFileId, HirFileIdRepr, MacroDefKind,
13}; 13};
@@ -41,9 +41,9 @@ impl Hygiene {
41 pub fn name_ref_to_name(&self, name_ref: ast::NameRef) -> Either<Name, CrateId> { 41 pub fn name_ref_to_name(&self, name_ref: ast::NameRef) -> Either<Name, CrateId> {
42 if let Some(def_crate) = self.def_crate { 42 if let Some(def_crate) = self.def_crate {
43 if name_ref.text() == "$crate" { 43 if name_ref.text() == "$crate" {
44 return Either::B(def_crate); 44 return Either::Right(def_crate);
45 } 45 }
46 } 46 }
47 Either::A(name_ref.as_name()) 47 Either::Left(name_ref.as_name())
48 } 48 }
49} 49}