diff options
| author | Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> | 2024-02-10 00:29:00 +0900 |
|---|---|---|
| committer | Tetsuharu Ohzeki <tetsuharu.ohzeki@gmail.com> | 2024-02-10 01:00:40 +0900 |
| commit | cb95ee3bc0d9814f83470de87446bd87ea44c1be (patch) | |
| tree | c0b3d4c3412c6b67c2093871b97eee9ccdf58e9a | |
| parent | 99f5d7ca4cb18b67481a548c9ce32e96f63e27e4 (diff) | |
| download | rust-cb95ee3bc0d9814f83470de87446bd87ea44c1be.tar.gz rust-cb95ee3bc0d9814f83470de87446bd87ea44c1be.zip | |
hir-def: Fix warnings about clippy `str_to_string` rule
| -rw-r--r-- | crates/hir-expand/src/builtin_fn_macro.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/hir-expand/src/builtin_fn_macro.rs b/crates/hir-expand/src/builtin_fn_macro.rs index 8d60f58628c..6d3de0e55d2 100644 --- a/crates/hir-expand/src/builtin_fn_macro.rs +++ b/crates/hir-expand/src/builtin_fn_macro.rs @@ -515,7 +515,7 @@ fn concat_bytes_expand( tt::TokenTree::Leaf(tt::Leaf::Literal(lit)) => { let token = ast::make::tokens::literal(&lit.to_string()); match token.kind() { - syntax::SyntaxKind::BYTE => bytes.push(token.text().to_string()), + syntax::SyntaxKind::BYTE => bytes.push(token.text().to_owned()), syntax::SyntaxKind::BYTE_STRING => { let components = unquote_byte_string(lit).unwrap_or_default(); components.into_iter().for_each(|it| bytes.push(it.to_string())); @@ -570,7 +570,7 @@ fn concat_bytes_expand_subtree( let lit = ast::make::tokens::literal(&lit.to_string()); match lit.kind() { syntax::SyntaxKind::BYTE | syntax::SyntaxKind::INT_NUMBER => { - bytes.push(lit.text().to_string()) + bytes.push(lit.text().to_owned()) } _ => { return Err(mbe::ExpandError::UnexpectedToken.into()); @@ -749,7 +749,7 @@ fn env_expand( // We cannot use an empty string here, because for // `include!(concat!(env!("OUT_DIR"), "/foo.rs"))` will become // `include!("foo.rs"), which might go to infinite loop - "UNRESOLVED_ENV_VAR".to_string() + "UNRESOLVED_ENV_VAR".to_owned() }); let expanded = quote! {span => #s }; |
