Update to syn 2 where possible (#30387)

* Update to syn 2 where possible

* Cleanups

* Better no_trace comment

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Samson 2023-09-19 17:57:37 +02:00 committed by GitHub
parent 7caac9790d
commit 8b30d1a4b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 57 additions and 54 deletions

View file

@ -56,7 +56,8 @@ pub struct RootTypeDef {
impl Parse for MacroInput {
fn parse(input: ParseStream<'_>) -> Result<Self> {
let fields: Punctuated<MacroArg, Token![, ]> = input.parse_terminated(MacroArg::parse)?;
let fields: Punctuated<MacroArg, Token![, ]> =
Punctuated::parse_terminated_with(input, MacroArg::parse)?;
let mut gen_accessors = None;
let mut type_def = None;
let mut accessor_type = None;
@ -134,7 +135,7 @@ impl Parse for NewTypeDef {
#[allow(clippy::eval_order_dependence)]
Ok(NewTypeDef {
_braces: braced!(content in input),
fields: content.parse_terminated(Field::parse)?,
fields: Punctuated::parse_terminated_with(&content, Field::parse)?,
})
}
}