Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/salsa/salsa-macros/src/parenthesized.rs')
| -rw-r--r-- | crates/salsa/salsa-macros/src/parenthesized.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/crates/salsa/salsa-macros/src/parenthesized.rs b/crates/salsa/salsa-macros/src/parenthesized.rs new file mode 100644 index 0000000000..9df41e03c1 --- /dev/null +++ b/crates/salsa/salsa-macros/src/parenthesized.rs @@ -0,0 +1,13 @@ +//! +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) + } +} |