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

fix(de): missing decode_default_with_tag_and_constraints #170

Merged
merged 1 commit into from
Oct 10, 2023

Conversation

6d7a
Copy link
Member

@6d7a 6d7a commented Oct 10, 2023

Adds a default implementation for the missing decode_default_with_tag_and_constraints.

A rasn-struct akin to the following would produce an error, because the Decode implementation calls a decode_default_with_tag_and_constraints method on the Decoder trait that did not exist.

#[derive(AsnType, Debug, Clone, Decode, Encode, PartialEq)]
#[rasn(automatic_tags)]
#[non_exhaustive]
pub struct DefaultTagAndConstraint {
    #[rasn(
        value("1..=4294967295"),
        default = "number_default"
    )]
    pub number: u32,
}

@XAMPPRocky
Copy link
Collaborator

Thank you for your PR!

@XAMPPRocky XAMPPRocky merged commit a2c94d5 into librasn:main Oct 10, 2023
17 of 68 checks passed
@github-actions github-actions bot mentioned this pull request Oct 10, 2023
@6d7a 6d7a deleted the fix/default-tag-constraints branch April 16, 2024 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants