refactor(dns): unify symbol naming

Renamed the following
- `dns::GenDnsConfig`  ->  `dns::Config`
- `dns::DnsConfig` -> `dns::async_std::Config`
- `dns::TokioDnsConfig` -> `dns::tokio::Config`

If async-std feature is enable, use `dns::async_std::Config`. When using tokio, import `dns::tokio::Config` . There is no need to use `dns::Config` directly.

Resolves #4486.
Related: #2217.

Pull-Request: #4505.
This commit is contained in:
whtsht
2023-09-24 14:31:42 +09:00
committed by GitHub
parent b4d9e5294b
commit 95890b550b
11 changed files with 154 additions and 127 deletions

View File

@ -33,9 +33,7 @@ use libp2p::{
transport::Transport,
upgrade,
},
dcutr,
dns::DnsConfig,
identify, identity, noise, ping, quic, relay,
dcutr, dns, identify, identity, noise, ping, quic, relay,
swarm::{NetworkBehaviour, SwarmBuilder, SwarmEvent},
tcp, yamux, PeerId,
};
@ -102,7 +100,7 @@ fn main() -> Result<(), Box<dyn Error>> {
&local_key,
)));
block_on(DnsConfig::system(relay_tcp_quic_transport))
block_on(dns::async_std::Transport::system(relay_tcp_quic_transport))
.unwrap()
.map(|either_output, _| match either_output {
Either::Left((peer_id, muxer)) => (peer_id, StreamMuxerBox::new(muxer)),