mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 19:25:56 +03:00
[PR #3134] [MERGED] Simplify and replace future combinators #3588
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#3588
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hickory-dns/hickory-dns/pull/3134
Author: @divergentdave
Created: 7/18/2025
Status: ✅ Merged
Merged: 7/22/2025
Merged by: @divergentdave
Base:
main← Head:david/replace-tryfuture-combinators📝 Commits (10+)
a555106Simplify future combinators in DnssecDnsHandledc63c41Replace future combinators in testsba4bb7eReplace future combinators in stream constructors46e381eRemove extra box in DNS multiplexer937a83cUse BoxFuture type aliasa62d20aRemove use of TryFutureExt in doc teste9c353cRemove unnecessary boxingd2bc7f4Replace uses of FutureExt::map with async blocks05f6cf7Rewrite test helper as async function23e04ecFurther simplify TcpStream::connect_with_future()📊 Changes
27 files changed (+251 additions, -305 deletions)
View changed files
📝
crates/proto/src/dnssec/dnssec_dns_handle/mod.rs(+10 -7)📝
crates/proto/src/h2/h2_client_stream.rs(+23 -32)📝
crates/proto/src/h3/h3_client_stream.rs(+6 -6)📝
crates/proto/src/multicast/mdns_client_stream.rs(+11 -11)📝
crates/proto/src/multicast/mdns_stream.rs(+36 -35)📝
crates/proto/src/quic/quic_client_stream.rs(+6 -7)📝
crates/proto/src/rustls/tls_client_stream.rs(+6 -16)📝
crates/proto/src/rustls/tls_stream.rs(+8 -29)📝
crates/proto/src/tcp/tcp_client_stream.rs(+2 -4)📝
crates/proto/src/tcp/tcp_stream.rs(+13 -20)📝
crates/proto/src/udp/udp_client_stream.rs(+1 -1)📝
crates/proto/src/udp/udp_stream.rs(+12 -7)📝
crates/proto/src/xfer/dns_exchange.rs(+8 -14)📝
crates/proto/src/xfer/dns_multiplexer.rs(+11 -10)📝
crates/proto/src/xfer/dns_response.rs(+4 -8)📝
crates/recursor/src/recursor_pool.rs(+5 -5)📝
crates/resolver/src/caching_client.rs(+3 -4)📝
crates/resolver/src/lib.rs(+4 -6)📝
crates/resolver/src/lookup_ip.rs(+5 -2)📝
crates/resolver/src/name_server/name_server_pool.rs(+3 -3)...and 7 more files
📄 Description
This replaces all
TryFutureExt::map_ok()andTryFutureExt::map_err()uses with async-await and regular control flow, or aFutureExt::map()call in one case where we need anUnpinfuture forselect_ok(). SomeFutureExt::map()uses are replaced with straight-line async code as well. AllBox<dyn Future + Unpin>types were replaced withPin<Box<dyn Future>>, because we may as well leverage the box allocation itself to satisfy pinning requirements. This also removes some unnecessaryFutureExt::boxed()calls where they aren't needed (including some cases that nested two boxes). I rewrote all pinned boxed future types with thefutures_util::futures::BoxFuturetype alias.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.