[PR #3375] [MERGED] Drop usage of EnumAsInner macro #3788

Closed
opened 2026-03-16 12:02:40 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/3375
Author: @djc
Created: 12/5/2025
Status: Merged
Merged: 12/8/2025
Merged by: @djc

Base: mainHead: no-enum-macro


📝 Commits (6)

  • aee06ae server: drop usage of EnumAsInner macro
  • 8401a7f recursor: drop usage of EnumAsInner macro
  • 86819eb server: deduplicate maybe_next_name()
  • 75df7e4 proto: statically type TSIG record data
  • 3fb4784 proto: statically type SIG record data
  • 9bf07fb proto: drop usage of EnumAsInner macro

📊 Changes

42 files changed (+597 additions, -668 deletions)

View changed files

📝 Cargo.lock (+0 -15)
📝 Cargo.toml (+0 -1)
📝 bin/tests/integration/forwarder.rs (+4 -2)
📝 bin/tests/integration/named_tests.rs (+4 -2)
📝 bin/tests/integration/zone_handler_battery/basic.rs (+240 -248)
📝 bin/tests/integration/zone_handler_battery/dnssec.rs (+11 -3)
📝 bin/tests/integration/zone_handler_battery/dynamic_update.rs (+13 -13)
📝 conformance/Cargo.lock (+0 -13)
📝 crates/proto/Cargo.toml (+0 -1)
📝 crates/proto/src/client/mod.rs (+5 -2)
📝 crates/proto/src/client/tests.rs (+4 -1)
📝 crates/proto/src/dnssec/handle.rs (+18 -19)
📝 crates/proto/src/dnssec/nsec3.rs (+10 -8)
📝 crates/proto/src/dnssec/rdata/mod.rs (+1 -2)
📝 crates/proto/src/dnssec/rdata/tsig.rs (+7 -13)
📝 crates/proto/src/dnssec/signer.rs (+8 -12)
📝 crates/proto/src/dnssec/tsig.rs (+2 -7)
📝 crates/proto/src/error.rs (+8 -9)
📝 crates/proto/src/h2/h2_client_stream.rs (+7 -7)
📝 crates/proto/src/h3/h3_client_stream.rs (+7 -7)

...and 22 more files

📄 Description

This macro was used on a bunch of our enums, but its usage was very limited:

  • Some uses were mostly in test code
  • Methods for most variants were unused

In the end, it feels like the "direct" matching is mostly easier to read at usage sites, there is no "magic" method addition (which had me confused for a while yesterday), and it saves on dependencies. This PR also net deletes a few lines of code (though it has some fun semi-related improvements spliced in).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hickory-dns/hickory-dns/pull/3375 **Author:** [@djc](https://github.com/djc) **Created:** 12/5/2025 **Status:** ✅ Merged **Merged:** 12/8/2025 **Merged by:** [@djc](https://github.com/djc) **Base:** `main` ← **Head:** `no-enum-macro` --- ### 📝 Commits (6) - [`aee06ae`](https://github.com/hickory-dns/hickory-dns/commit/aee06ae9c5af0b455a393fd15dbdaf210e791600) server: drop usage of EnumAsInner macro - [`8401a7f`](https://github.com/hickory-dns/hickory-dns/commit/8401a7f37c02379f01eb46098b31df34667b15a6) recursor: drop usage of EnumAsInner macro - [`86819eb`](https://github.com/hickory-dns/hickory-dns/commit/86819ebc1386c0ed3a2898af7dccde9f7f098e03) server: deduplicate maybe_next_name() - [`75df7e4`](https://github.com/hickory-dns/hickory-dns/commit/75df7e42d22cea513d3cde14f451fb4d61e8b51c) proto: statically type TSIG record data - [`3fb4784`](https://github.com/hickory-dns/hickory-dns/commit/3fb4784b3c121ad98bf27fab48bb527c6a5c16ca) proto: statically type SIG record data - [`9bf07fb`](https://github.com/hickory-dns/hickory-dns/commit/9bf07fbb84347052047e13f05f8e379b9f3b6aab) proto: drop usage of EnumAsInner macro ### 📊 Changes **42 files changed** (+597 additions, -668 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+0 -15) 📝 `Cargo.toml` (+0 -1) 📝 `bin/tests/integration/forwarder.rs` (+4 -2) 📝 `bin/tests/integration/named_tests.rs` (+4 -2) 📝 `bin/tests/integration/zone_handler_battery/basic.rs` (+240 -248) 📝 `bin/tests/integration/zone_handler_battery/dnssec.rs` (+11 -3) 📝 `bin/tests/integration/zone_handler_battery/dynamic_update.rs` (+13 -13) 📝 `conformance/Cargo.lock` (+0 -13) 📝 `crates/proto/Cargo.toml` (+0 -1) 📝 `crates/proto/src/client/mod.rs` (+5 -2) 📝 `crates/proto/src/client/tests.rs` (+4 -1) 📝 `crates/proto/src/dnssec/handle.rs` (+18 -19) 📝 `crates/proto/src/dnssec/nsec3.rs` (+10 -8) 📝 `crates/proto/src/dnssec/rdata/mod.rs` (+1 -2) 📝 `crates/proto/src/dnssec/rdata/tsig.rs` (+7 -13) 📝 `crates/proto/src/dnssec/signer.rs` (+8 -12) 📝 `crates/proto/src/dnssec/tsig.rs` (+2 -7) 📝 `crates/proto/src/error.rs` (+8 -9) 📝 `crates/proto/src/h2/h2_client_stream.rs` (+7 -7) 📝 `crates/proto/src/h3/h3_client_stream.rs` (+7 -7) _...and 22 more files_ </details> ### 📄 Description This macro was used on a bunch of our enums, but its usage was very limited: - Some uses were mostly in test code - Methods for most variants were unused In the end, it feels like the "direct" matching is mostly easier to read at usage sites, there is no "magic" method addition (which had me confused for a while yesterday), and it saves on dependencies. This PR also net deletes a few lines of code (though it has some fun semi-related improvements spliced in). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 12:02:40 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#3788
No description provided.