Fix ignored variant requires Default trait#39
Merged
Conversation
Ignored variants no longer need the Default trait implemented, even when they have fields. Previously, the macro generated Default::default() for all variants in deserialization code, causing compile errors for ignored variants without Default.
Previously used ::keymap_parser which fails when keymap is not the root crate. Now uses keymap_parser (without ::) which resolves correctly.
bb571ab to
a4cc162
Compare
…nding Add support for u8, u16, u32, u64, and usize field types when using @Digit key group. The character from key event is automatically converted to its numeric digit value and cast to the target type.
a4cc162 to
0015e26
Compare
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.
Ignored variants like the following code shouldn't require a
Defaulttrait implementation.The
Defaulttrait was introduced in v1.0.0-rc3, which allows users to capture default values intoNamedandUnnamedvariants. However, it doesn't respect the ignore field. Thus, any code that uses the ignore field requires the Default trait to be implemented (undesired behavior).