diff options
author | Aleksey Kladov <[email protected]> | 2018-12-27 17:07:21 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-12-27 17:07:21 +0000 |
commit | d963042ca9da93be8d5922ce46ea26dc6a79c929 (patch) | |
tree | 76f7bfc934dda4e9dfc956fc86fe73379d86a332 /crates/ra_hir/src/ty.rs | |
parent | 3b820bcca3a66660d0c5960f2a5c8f765095333e (diff) |
introduce hir::Name
Diffstat (limited to 'crates/ra_hir/src/ty.rs')
-rw-r--r-- | crates/ra_hir/src/ty.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs index 67b523c2c..dc3323b1a 100644 --- a/crates/ra_hir/src/ty.rs +++ b/crates/ra_hir/src/ty.rs | |||
@@ -179,13 +179,13 @@ impl Ty { | |||
179 | module: &Module, | 179 | module: &Module, |
180 | path: &Path, | 180 | path: &Path, |
181 | ) -> Cancelable<Self> { | 181 | ) -> Cancelable<Self> { |
182 | if path.is_ident() { | 182 | if let Some(name) = path.as_ident() { |
183 | let name = &path.segments[0]; | 183 | let name = name.as_str(); // :-( |
184 | if let Some(int_ty) = primitive::IntTy::from_string(&name) { | 184 | if let Some(int_ty) = primitive::IntTy::from_string(name) { |
185 | return Ok(Ty::Int(int_ty)); | 185 | return Ok(Ty::Int(int_ty)); |
186 | } else if let Some(uint_ty) = primitive::UintTy::from_string(&name) { | 186 | } else if let Some(uint_ty) = primitive::UintTy::from_string(name) { |
187 | return Ok(Ty::Uint(uint_ty)); | 187 | return Ok(Ty::Uint(uint_ty)); |
188 | } else if let Some(float_ty) = primitive::FloatTy::from_string(&name) { | 188 | } else if let Some(float_ty) = primitive::FloatTy::from_string(name) { |
189 | return Ok(Ty::Float(float_ty)); | 189 | return Ok(Ty::Float(float_ty)); |
190 | } | 190 | } |
191 | } | 191 | } |