From 46b4f89c920c314caf1a8af2abdb09732d100d67 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 20 Jan 2021 01:56:11 +0300 Subject: . --- crates/hir_expand/src/builtin_derive.rs | 2 +- crates/hir_expand/src/name.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/hir_expand') diff --git a/crates/hir_expand/src/builtin_derive.rs b/crates/hir_expand/src/builtin_derive.rs index eb257579f..b7f1aae8f 100644 --- a/crates/hir_expand/src/builtin_derive.rs +++ b/crates/hir_expand/src/builtin_derive.rs @@ -102,7 +102,7 @@ fn parse_adt(tt: &tt::Subtree) -> Result { debug!("name token not found"); mbe::ExpandError::ConversionError })?; - let name_token = tt::Ident { id: name_token_id, text: name.text().clone() }; + let name_token = tt::Ident { id: name_token_id, text: name.text().into() }; let type_params = params.map_or(0, |type_param_list| type_param_list.type_params().count()); Ok(BasicAdtInfo { name: name_token, type_params }) } diff --git a/crates/hir_expand/src/name.rs b/crates/hir_expand/src/name.rs index 95d853b6d..d692cec14 100644 --- a/crates/hir_expand/src/name.rs +++ b/crates/hir_expand/src/name.rs @@ -38,7 +38,7 @@ impl Name { } pub fn new_lifetime(lt: &ast::Lifetime) -> Name { - Self::new_text(lt.text().clone()) + Self::new_text(lt.text().into()) } /// Shortcut to create inline plain text name @@ -47,12 +47,12 @@ impl Name { } /// Resolve a name from the text of token. - fn resolve(raw_text: &SmolStr) -> Name { + fn resolve(raw_text: &str) -> Name { let raw_start = "r#"; - if raw_text.as_str().starts_with(raw_start) { + if raw_text.starts_with(raw_start) { Name::new_text(SmolStr::new(&raw_text[raw_start.len()..])) } else { - Name::new_text(raw_text.clone()) + Name::new_text(raw_text.into()) } } -- cgit v1.2.3