File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -2347,19 +2347,19 @@ fn get_all_import_attributes<'hir>(
2347
2347
}
2348
2348
2349
2349
fn filter_tokens_from_list (
2350
- args_tokens : TokenStream ,
2350
+ args_tokens : & TokenStream ,
2351
2351
should_retain : impl Fn ( & TokenTree ) -> bool ,
2352
2352
) -> Vec < TokenTree > {
2353
2353
let mut tokens = Vec :: with_capacity ( args_tokens. len ( ) ) ;
2354
2354
let mut skip_next_comma = false ;
2355
- for token in args_tokens. into_trees ( ) {
2355
+ for token in args_tokens. trees ( ) {
2356
2356
match token {
2357
2357
TokenTree :: Token ( Token { kind : TokenKind :: Comma , .. } , _) if skip_next_comma => {
2358
2358
skip_next_comma = false ;
2359
2359
}
2360
- token if should_retain ( & token) => {
2360
+ token if should_retain ( token) => {
2361
2361
skip_next_comma = false ;
2362
- tokens. push ( token) ;
2362
+ tokens. push ( token. clone ( ) ) ;
2363
2363
}
2364
2364
_ => {
2365
2365
skip_next_comma = true ;
@@ -2417,7 +2417,7 @@ fn add_without_unwanted_attributes<'hir>(
2417
2417
match normal. item . args {
2418
2418
ast:: AttrArgs :: Delimited ( ref mut args) => {
2419
2419
let tokens =
2420
- filter_tokens_from_list ( args. tokens . clone ( ) , |token| {
2420
+ filter_tokens_from_list ( & args. tokens , |token| {
2421
2421
!matches ! (
2422
2422
token,
2423
2423
TokenTree :: Token (
You can’t perform that action at this time.
0 commit comments