@@ -515,7 +515,7 @@ fn concat_bytes_expand(
515
515
tt:: TokenTree :: Leaf ( tt:: Leaf :: Literal ( lit) ) => {
516
516
let token = ast:: make:: tokens:: literal ( & lit. to_string ( ) ) ;
517
517
match token. kind ( ) {
518
- syntax:: SyntaxKind :: BYTE => bytes. push ( token. text ( ) . to_string ( ) ) ,
518
+ syntax:: SyntaxKind :: BYTE => bytes. push ( token. text ( ) . to_owned ( ) ) ,
519
519
syntax:: SyntaxKind :: BYTE_STRING => {
520
520
let components = unquote_byte_string ( lit) . unwrap_or_default ( ) ;
521
521
components. into_iter ( ) . for_each ( |it| bytes. push ( it. to_string ( ) ) ) ;
@@ -570,7 +570,7 @@ fn concat_bytes_expand_subtree(
570
570
let lit = ast:: make:: tokens:: literal ( & lit. to_string ( ) ) ;
571
571
match lit. kind ( ) {
572
572
syntax:: SyntaxKind :: BYTE | syntax:: SyntaxKind :: INT_NUMBER => {
573
- bytes. push ( lit. text ( ) . to_string ( ) )
573
+ bytes. push ( lit. text ( ) . to_owned ( ) )
574
574
}
575
575
_ => {
576
576
return Err ( mbe:: ExpandError :: UnexpectedToken . into ( ) ) ;
@@ -749,7 +749,7 @@ fn env_expand(
749
749
// We cannot use an empty string here, because for
750
750
// `include!(concat!(env!("OUT_DIR"), "/foo.rs"))` will become
751
751
// `include!("foo.rs"), which might go to infinite loop
752
- "UNRESOLVED_ENV_VAR" . to_string ( )
752
+ "UNRESOLVED_ENV_VAR" . to_owned ( )
753
753
} ) ;
754
754
let expanded = quote ! { span => #s } ;
755
755
0 commit comments