Skip to content

Commit

Permalink
Allow parse_quote! to produce Vec<Attribute>
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Oct 31, 2024
1 parent 293d7c9 commit 7436bb2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/parse_quote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,17 @@ impl ParseQuote for Attribute {
}
}

#[cfg(any(feature = "full", feature = "derive"))]
impl ParseQuote for Vec<Attribute> {
fn parse(input: ParseStream) -> Result<Self> {
let mut attrs = Vec::new();
while !input.is_empty() {
attrs.push(ParseQuote::parse(input)?);
}
Ok(attrs)
}
}

#[cfg(any(feature = "full", feature = "derive"))]
impl ParseQuote for Field {
fn parse(input: ParseStream) -> Result<Self> {
Expand Down

0 comments on commit 7436bb2

Please sign in to comment.