refactor: use by-ref TokenTree iterator to avoid a few clones
This commit is contained in:
parent
5b24e12785
commit
05c5df5682
3 changed files with 6 additions and 6 deletions
|
@ -19,7 +19,7 @@ pub fn expand_concat_idents<'cx>(
|
|||
}
|
||||
|
||||
let mut res_str = String::new();
|
||||
for (i, e) in tts.into_trees().enumerate() {
|
||||
for (i, e) in tts.trees().enumerate() {
|
||||
if i & 1 == 1 {
|
||||
match e {
|
||||
TokenTree::Token(Token { kind: token::Comma, .. }, _) => {}
|
||||
|
|
|
@ -8,7 +8,7 @@ pub fn expand_trace_macros(
|
|||
sp: Span,
|
||||
tt: TokenStream,
|
||||
) -> Box<dyn base::MacResult + 'static> {
|
||||
let mut cursor = tt.into_trees();
|
||||
let mut cursor = tt.trees();
|
||||
let mut err = false;
|
||||
let value = match &cursor.next() {
|
||||
Some(TokenTree::Token(token, _)) if token.is_keyword(kw::True) => true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue