Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir_expand/src/name.rs')
| -rw-r--r-- | crates/hir_expand/src/name.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/hir_expand/src/name.rs b/crates/hir_expand/src/name.rs index 9c844c6138..552603dce7 100644 --- a/crates/hir_expand/src/name.rs +++ b/crates/hir_expand/src/name.rs @@ -48,10 +48,9 @@ impl Name { /// Resolve a name from the text of token. fn resolve(raw_text: &str) -> Name { - if let Some(text) = raw_text.strip_prefix("r#") { - Name::new_text(SmolStr::new(text)) - } else { - Name::new_text(raw_text.into()) + match raw_text.strip_prefix("r#") { + Some(text) => Name::new_text(SmolStr::new(text)), + None => Name::new_text(raw_text.into()), } } |