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

deserialize_identifier: add support for all types expected by serde #8

Merged

Commits on Oct 7, 2024

  1. deserialize_identifier: add support for all types expected by serde

    The default serde deserialize derive accepts 3 types for identifiers:
    
    - The name of the field as `str`
    - The name of the field as ascii bytes
    - The index of the field as u64
    
    This PR changes deserialize_identifier to have compatibility with all of these
    This is necessary for Nitrokey/fido-authenticator#57,
    which needs compatibility with both the str variant and the index variant
    sosthene-nitrokey committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    32df258 View commit details
    Browse the repository at this point in the history
  2. Handle bytes identifier as UTF-8 strings

    Previously, we visited either strings or bytes so that the visitor had
    to handle both cases.  With this change, we always visit strings so that
    the bytes visitor function can be optimized out. This significantly
    reduces binary size.
    robin-nitrokey authored and sosthene-nitrokey committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    e025b33 View commit details
    Browse the repository at this point in the history