-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support with
on magic field attrs
#273
Labels
Comments
TedDriggs
added a commit
that referenced
this issue
Feb 23, 2024
This allows the `attrs` magic field to have any type, rather than being limited to `Vec<Attribute>`. Fixes #273
TedDriggs
added a commit
that referenced
this issue
Feb 23, 2024
This allows the `attrs` magic field to have any type, rather than being limited to `Vec<Attribute>`. Fixes #273
TedDriggs
added a commit
that referenced
this issue
Feb 23, 2024
This allows the `attrs` magic field to have any type, rather than being limited to `Vec<Attribute>`. Fixes #273
TedDriggs
added a commit
that referenced
this issue
Feb 23, 2024
This allows the `attrs` magic field to have any type, rather than being limited to `Vec<Attribute>`. Fixes #273
TedDriggs
added a commit
that referenced
this issue
Feb 23, 2024
This allows the `attrs` magic field to have any type, rather than being limited to `Vec<Attribute>`. Fixes #273
TedDriggs
added a commit
that referenced
this issue
Feb 23, 2024
This allows the `attrs` magic field to have any type, rather than being limited to `Vec<Attribute>`. Fixes #273
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In colin-kiegel/rust-derive-builder#310, @dtolnay pointed out some clunky code that handles “distribution and unnesting” of attributes. The
Options
struct is forced to have anattrs
field that is only temporarily used.This can be avoided by allowing the deriver of
FromDeriveInput
et alia to provide a conversion function that takes attributes and returns adarling::Result<?>
This function must participate in the error accumulator behavior of the rest of the derived impl, so it must be invoked before the error check, and we’ll need a new local variable for the output.
with
makes more sense than the postfix items, since this must allow failure and doesn’t itself take in aResult
The text was updated successfully, but these errors were encountered: