Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove redundant async signature #5468

Merged
merged 6 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions libp2p/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
- Use `web-time` instead of `instant`.
See [PR 5347](https://github.com/libp2p/rust-libp2p/pull/5347).

- Remove redundant async signature.
guillaumemichel marked this conversation as resolved.
Show resolved Hide resolved
See [PR 5468](https://github.com/libp2p/rust-libp2p/pull/5468).

## 0.53.2

- Allow `SwarmBuilder::with_bandwidth_metrics` after `SwarmBuilder::with_websocket`.
Expand Down
3 changes: 1 addition & 2 deletions libp2p/src/builder/phase/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ pub struct DnsPhase<T> {

#[cfg(all(not(target_arch = "wasm32"), feature = "async-std", feature = "dns"))]
impl<T: AuthenticatedMultiplexedTransport> SwarmBuilder<super::provider::AsyncStd, DnsPhase<T>> {
// TODO: Remove `async`
pub async fn with_dns(
pub fn with_dns(
self,
) -> Result<
SwarmBuilder<
Expand Down
4 changes: 2 additions & 2 deletions libp2p/src/builder/phase/other_transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl<Provider, T: AuthenticatedMultiplexedTransport>
impl<T: AuthenticatedMultiplexedTransport>
SwarmBuilder<super::provider::AsyncStd, OtherTransportPhase<T>>
{
pub async fn with_dns(
pub fn with_dns(
self,
) -> Result<
SwarmBuilder<
Expand All @@ -82,7 +82,7 @@ impl<T: AuthenticatedMultiplexedTransport>
>,
std::io::Error,
> {
self.without_any_other_transports().with_dns().await
self.without_any_other_transports().with_dns()
}
}
#[cfg(all(not(target_arch = "wasm32"), feature = "tokio", feature = "dns"))]
Expand Down
3 changes: 1 addition & 2 deletions libp2p/src/builder/phase/quic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ impl<Provider, T: AuthenticatedMultiplexedTransport> SwarmBuilder<Provider, Quic
}
#[cfg(all(not(target_arch = "wasm32"), feature = "async-std", feature = "dns"))]
impl<T: AuthenticatedMultiplexedTransport> SwarmBuilder<super::provider::AsyncStd, QuicPhase<T>> {
pub async fn with_dns(
pub fn with_dns(
self,
) -> Result<
SwarmBuilder<
Expand All @@ -162,7 +162,6 @@ impl<T: AuthenticatedMultiplexedTransport> SwarmBuilder<super::provider::AsyncSt
self.without_quic()
guillaumemichel marked this conversation as resolved.
Show resolved Hide resolved
.without_any_other_transports()
.with_dns()
.await
}
}
#[cfg(all(not(target_arch = "wasm32"), feature = "tokio", feature = "dns"))]
Expand Down
Loading