Skip to content
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

feat: Improve settings macros to handle default #13

Merged
merged 1 commit into from
Oct 16, 2024
Merged

Conversation

reneca
Copy link
Contributor

@reneca reneca commented Oct 3, 2024

Since settings and proc_settings macros are adding members to a struct,when you try to implement Default trait, you have an issue because you also need to specify those extra members.

The feat is here to do it seamlessly. You only have to use the macro when you implement the Default trait and forget about extra members.

See doc example in the change to know more.

@reneca reneca added the enhancement New feature or request label Oct 3, 2024
@reneca reneca requested review from Timmy80 and oschijns October 3, 2024 07:58
@reneca reneca self-assigned this Oct 3, 2024
Copy link
Collaborator

@oschijns oschijns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#[proc_settings] does not prevent manual implementation of the Default trait.
#[proc_settings] provide appropriate compiler error messages when used incorrectly.

@reneca reneca merged commit 2095efe into main Oct 16, 2024
6 checks passed
@reneca reneca deleted the default-settings branch October 16, 2024 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants