Skip to content

Commit

Permalink
Merge pull request #1775 from dtolnay/pqattr
Browse files Browse the repository at this point in the history
Allow `parse_quote!` to produce Vec<Attribute>
  • Loading branch information
dtolnay authored Oct 31, 2024
2 parents 293d7c9 + 7436bb2 commit 58762c4
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 58762c4

Please sign in to comment.