Skip to content

Conversation

@SteveLauC
Copy link
Member

What does this PR do

For those types implementing trait RegisterSet, defining them with zero-variants enum rather than unit struct as we don't want our users to construct them, and an enum with 0 variants will never be constructed, so using it is more suitable than using unit struct here.

For more discussion, see this thread.

This is not an API change unless users are constructing those unit struct types, which should have no use cases, so no CHANGELOG needed.

Checklist:

  • I have read CONTRIBUTING.md
  • I have written necessary tests and rustdoc comments
  • A change log has been added if this PR modifies nix's API

@SteveLauC SteveLauC added this pull request to the merge queue May 6, 2024
Merged via the queue into nix-rust:master with commit ac3373b May 6, 2024
@SteveLauC SteveLauC deleted the refactor/use_zero_variants_enum_for_RegisterSet branch May 6, 2024 12:42
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.

1 participant