1
Fork 0

use CursorRef more, to not to clone Trees

This commit is contained in:
klensy 2022-05-16 18:58:15 +03:00
parent 10b3a0d209
commit cc5f3e21ac
10 changed files with 35 additions and 24 deletions

View file

@ -400,7 +400,7 @@ impl<'a> StripUnconfigured<'a> {
// Use the `#` in `#[cfg_attr(pred, attr)]` as the `#` token
// for `attr` when we expand it to `#[attr]`
let mut orig_trees = orig_tokens.trees();
let mut orig_trees = orig_tokens.into_trees();
let TokenTree::Token(pound_token @ Token { kind: TokenKind::Pound, .. }) = orig_trees.next().unwrap() else {
panic!("Bad tokens for attribute {:?}", attr);
};