diff options
author | HampusM <hampus@hampusmat.com> | 2022-08-27 23:41:41 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-08-27 23:41:41 +0200 |
commit | e0f90a8e384615c79d7d51c66d19294d75e79391 (patch) | |
tree | f3df3d1cd92f7d4a978feaa5a9a5f773dd0901ee /macros/src/named_attr_input.rs | |
parent | d4078c84a83d121a4e3492955359cedb3b404476 (diff) |
feat: implement named bindings
Diffstat (limited to 'macros/src/named_attr_input.rs')
-rw-r--r-- | macros/src/named_attr_input.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/macros/src/named_attr_input.rs b/macros/src/named_attr_input.rs new file mode 100644 index 0000000..5f7123c --- /dev/null +++ b/macros/src/named_attr_input.rs @@ -0,0 +1,21 @@ +use syn::parse::Parse; +use syn::{parenthesized, LitStr}; + +pub struct NamedAttrInput +{ + pub name: LitStr, +} + +impl Parse for NamedAttrInput +{ + fn parse(input: syn::parse::ParseStream) -> syn::Result<Self> + { + let content; + + parenthesized!(content in input); + + Ok(Self { + name: content.parse()?, + }) + } +} |