Optimize Cursor::look_ahead
Cloning a tt is cheap, but not free (there's Arc inside).
This commit is contained in:
parent
850c3219fb
commit
09d3db2e59
3 changed files with 15 additions and 10 deletions
|
@ -47,13 +47,18 @@ impl ToInternal<token::DelimToken> for Delimiter {
|
|||
}
|
||||
}
|
||||
|
||||
impl FromInternal<(TreeAndJoint, Option<tokenstream::TokenTree>, &'_ ParseSess, &'_ mut Vec<Self>)>
|
||||
for TokenTree<Group, Punct, Ident, Literal>
|
||||
impl
|
||||
FromInternal<(
|
||||
TreeAndJoint,
|
||||
Option<&'_ tokenstream::TokenTree>,
|
||||
&'_ ParseSess,
|
||||
&'_ mut Vec<Self>,
|
||||
)> for TokenTree<Group, Punct, Ident, Literal>
|
||||
{
|
||||
fn from_internal(
|
||||
((tree, is_joint), look_ahead, sess, stack): (
|
||||
TreeAndJoint,
|
||||
Option<tokenstream::TokenTree>,
|
||||
Option<&tokenstream::TokenTree>,
|
||||
&ParseSess,
|
||||
&mut Vec<Self>,
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue