feat: add into, optional, const and skip options with enhanced visibility parser (closes #30, #31)#125
Open
mahdi739 wants to merge 4 commits intojbaublitz:mainfrom
Conversation
into, optional, const and skip options with enhanced visibility parserinto, optional, const and skip options with enhanced visibility parser (closes #30, #31)
Owner
|
Hi @mahdi739, thanks for your contribution. Could you resolve the CI issues? I'll take a look after that. |
Author
|
Hi @jbaublitz. I didn't understand the error. But I can resolve the clippy warnings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces
into,optional,const, andskipoptions for related macros.intois only allowed forsetandset_with. It enables setters to acceptstd::convert::Into<T>for a field typeT.Example:
optionalis only allowed forsetandset_with, and the field must be anOption<T>type. It allows setters to acceptTinstead ofOption<T>.Example:
optionalandintocan be used together:constmakes the related methodconst. Due to its strict constraints, any compile-time errors that arise when using it must be handled by the user.Example:
skipexcludes the attribute individually. It is incompatible with other options and must be used alone for that specific attribute. Note that it's different than the skip attribute.Example:
Additionally, the visibility parser has been improved to support more complex visibility specifiers, such as
pub(in crate).