refactor: deduplicate query/record/sinkhole helpers #22

Merged
razvandimescu merged 1 commits from refactor/dedup-helpers into main 2026-03-29 19:22:07 +08:00

1 Commits

Author SHA1 Message Date
Razvan Dimescu
f6a12da5e3 refactor: deduplicate query builders, record extraction, sinkhole records
- Add DnsPacket::query(id, domain, qtype) constructor; replace mock_query,
  make_query, and 4 inline constructions across ctx/forward/recursive/api
- Add record_to_addr() in recursive.rs; replace 4 identical A/AAAA match
  blocks with filter_map one-liners
- Add sinkhole_record() in ctx.rs; consolidate localhost and blocklist
  A/AAAA branching into single calls
- Remove now-unused DnsQuestion imports

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 14:18:54 +03:00