diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-06-13 23:16:40 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-06-14 13:53:02 +0200 |
| commit | c81e2a5f56eb262663f292578c683fba7f18251f (patch) | |
| tree | 6c045a8dcbec5e75e01a15f970ef8cee6ff042d0 /macros | |
| parent | 891af17260a6750a74a102388a05e59cf1ffc3c1 (diff) | |
Many fixes
Diffstat (limited to 'macros')
| -rw-r--r-- | macros/src/lib.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/macros/src/lib.rs b/macros/src/lib.rs index 029a1adb..6871be1c 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -116,7 +116,7 @@ fn process_const( ) -> Result<(Property, syn::ItemMod)> { let property = parse_property(item)?; - // The display name, e.g. `TextNode::STRONG`. + // The display name, e.g. `TextNode::BOLD`. let name = format!("{}::{}", self_name, &item.ident); // The type of the property's value is what the user of our macro wrote @@ -134,7 +134,7 @@ fn process_const( value_ty.clone() }; - // ... but the real type of the const becomes this.. + // ... but the real type of the const becomes this ... let key = quote! { Key<#value_ty, #self_args> }; let phantom_args = self_args.iter().filter(|arg| match arg { syn::GenericArgument::Type(syn::Type::Path(path)) => { @@ -148,9 +148,11 @@ fn process_const( let default = &item.expr; - // Ensure that the type is either `Copy` or that the property is referenced - // or that the property isn't copy but can't be referenced because it needs - // folding. + // Ensure that the type is + // - either `Copy`, or + // - that the property is referenced, or + // - that the property isn't copy but can't be referenced because it needs + // folding. let get; let mut copy = None; |
