From a9f55029b9db3bcd439d31c5007785299f7d4025 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 27 Dec 2018 20:26:15 +0300 Subject: introduce known names --- crates/ra_hir/src/ty.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'crates/ra_hir/src/ty.rs') diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs index dc3323b1a..ad097d1f1 100644 --- a/crates/ra_hir/src/ty.rs +++ b/crates/ra_hir/src/ty.rs @@ -95,7 +95,7 @@ pub enum Ty { Tuple(Vec), // The projection of an associated type. For example, - // `>::N`. + // `>::N`.pub // Projection(ProjectionTy), // Opaque (`impl Trait`) type found in a return type. @@ -180,12 +180,11 @@ impl Ty { path: &Path, ) -> Cancelable { if let Some(name) = path.as_ident() { - let name = name.as_str(); // :-( - if let Some(int_ty) = primitive::IntTy::from_string(name) { + if let Some(int_ty) = primitive::IntTy::from_name(name) { return Ok(Ty::Int(int_ty)); - } else if let Some(uint_ty) = primitive::UintTy::from_string(name) { + } else if let Some(uint_ty) = primitive::UintTy::from_name(name) { return Ok(Ty::Uint(uint_ty)); - } else if let Some(float_ty) = primitive::FloatTy::from_string(name) { + } else if let Some(float_ty) = primitive::FloatTy::from_name(name) { return Ok(Ty::Float(float_ty)); } } -- cgit v1.2.3