rust/crates/salsa/salsa-macros/src/parenthesized.rs
Lukas Wirth 3688064ff5 Clippy
2024-02-07 17:08:38 +01:00

14 lines
332 B
Rust

//!
pub(crate) struct Parenthesized<T>(pub(crate) T);
impl<T> syn::parse::Parse for Parenthesized<T>
where
T: syn::parse::Parse,
{
fn parse(input: syn::parse::ParseStream<'_>) -> syn::Result<Self> {
let content;
syn::parenthesized!(content in input);
content.parse::<T>().map(Parenthesized)
}
}