Skip to content

Commit cb95ee3

Browse files
hir-def: Fix warnings about clippy str_to_string rule
1 parent 99f5d7c commit cb95ee3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/hir-expand/src/builtin_fn_macro.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ fn concat_bytes_expand(
515515
tt::TokenTree::Leaf(tt::Leaf::Literal(lit)) => {
516516
let token = ast::make::tokens::literal(&lit.to_string());
517517
match token.kind() {
518-
syntax::SyntaxKind::BYTE => bytes.push(token.text().to_string()),
518+
syntax::SyntaxKind::BYTE => bytes.push(token.text().to_owned()),
519519
syntax::SyntaxKind::BYTE_STRING => {
520520
let components = unquote_byte_string(lit).unwrap_or_default();
521521
components.into_iter().for_each(|it| bytes.push(it.to_string()));
@@ -570,7 +570,7 @@ fn concat_bytes_expand_subtree(
570570
let lit = ast::make::tokens::literal(&lit.to_string());
571571
match lit.kind() {
572572
syntax::SyntaxKind::BYTE | syntax::SyntaxKind::INT_NUMBER => {
573-
bytes.push(lit.text().to_string())
573+
bytes.push(lit.text().to_owned())
574574
}
575575
_ => {
576576
return Err(mbe::ExpandError::UnexpectedToken.into());
@@ -749,7 +749,7 @@ fn env_expand(
749749
// We cannot use an empty string here, because for
750750
// `include!(concat!(env!("OUT_DIR"), "/foo.rs"))` will become
751751
// `include!("foo.rs"), which might go to infinite loop
752-
"UNRESOLVED_ENV_VAR".to_string()
752+
"UNRESOLVED_ENV_VAR".to_owned()
753753
});
754754
let expanded = quote! {span => #s };
755755

0 commit comments

Comments
 (0)