syn
syn copied to clipboard
`parse` should take a `&mut ParseStream`
Maybe there is an obvious reason, but I was not able to find any justification, so I will ask my question here. Forgive me if it is naive.
Why does the parse
function in the trait Parse
take an immutable reference to a ParseStream
?
I had to read the docs for hours before understanding that each time you call parse
, the stream mutates (It is never explained in the examples).
Since the parse
function really mutates its input, I think it would be clearer to change its signature ...
And since the user entry-point is parse_macro_input!
, I don't think it would change a lot of things for the user.